package typed
- Alphabetic
- By Inheritance
- typed
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
ActorContext
[T] extends AnyRef
An Actor is given by the combination of a Behavior and a context in which this behavior is executed.
An Actor is given by the combination of a Behavior and a context in which this behavior is executed. As per the Actor Model an Actor can perform the following actions when processing a message:
- send a finite number of messages to other Actors it knows
- create a finite number of Actors
- designate the behavior for the next message
In Akka the first capability is accessed by using the
!
ortell
method on an ActorRef, the second is provided by ActorContext#spawn and the third is implicit in the signature of Behavior in that the next behavior is always returned from the message processing logic.An
ActorContext
in addition provides access to the Actor’s own identity (“self
”), the ActorSystem it is part of, methods for querying the list of child Actors it created, access to DeathWatch and timed message scheduling. -
abstract
class
ActorRef
[-T] extends Comparable[ActorRef[Nothing]]
An ActorRef is the identity or address of an Actor instance.
An ActorRef is the identity or address of an Actor instance. It is valid only during the Actor’s lifetime and allows messages to be sent to that Actor instance. Sending a message to an Actor that has terminated before receiving the message will lead to that message being discarded; such messages are delivered to the akka.actor.DeadLetter channel of the akka.event.EventStream on a best effort basis (i.e. this delivery is not reliable).
-
trait
ActorSystem
[-T] extends ActorRef[T]
An ActorSystem is home to a hierarchy of Actors.
An ActorSystem is home to a hierarchy of Actors. It is created using ActorSystem$
apply
from a Props object that describes the root Actor of this hierarchy and which will create all other Actors beneath it. A system also implements the ActorRef type, and sending a message to the system directs that message to the root Actor. -
abstract
class
Behavior
[T] extends AnyRef
The behavior of an actor defines how it reacts to the messages that it receives.
The behavior of an actor defines how it reacts to the messages that it receives. The message may either be of the type that the Actor declares and which is part of the ActorRef signature, or it may be a system Signal that expresses a lifecycle event of either this actor or one of its child actors.
Behaviors can be formulated in a number of different ways, either by creating a derived class or by employing factory methods like the ones in the ScalaDSL$ object.
-
class
BusLogging
extends LoggingAdapter
akka.event.LoggingAdapter that publishes akka.event.Logging.LogEvent to event stream.
-
final
case class
DeadLetter
(msg: Any) extends Product with Serializable
Envelope for dead letters.
-
final
case class
DeathPactException
(ref: ActorRef[Nothing]) extends RuntimeException with Product with Serializable
Exception that an actor fails with if it does not handle a Terminated message.
- class DefaultLogger extends Logger with StdOutLogger
- class DefaultLoggingFilter extends event.DefaultLoggingFilter
-
abstract
class
DeploymentConfig
extends Product with Serializable
Data structure for describing an actor’s deployment details like which executor to run it on.
Data structure for describing an actor’s deployment details like which executor to run it on. For each type of setting (e.g. DispatcherSelector or MailboxCapacity) the FIRST occurrence is used when creating the actor; this means that adding configuration using the "with" methods overrides what was configured previously.
Deliberately not sealed in order to emphasize future extensibility by the framework—this is not intended to be extended by user code.
The DeploymentConfig includes a
next
reference so that it can form an internally linked list. Traversal of this list stops when encountering the EmptyDeploymentConfig$ object. -
sealed
case class
DispatcherDefault
(next: DeploymentConfig) extends DeploymentConfig with DispatcherSelector with Product with Serializable
Use the ActorSystem default executor to run the actor.
-
final
case class
DispatcherFromConfig
(path: String, next: DeploymentConfig = EmptyDeploymentConfig) extends DeploymentConfig with DispatcherSelector with Product with Serializable
Look up an executor definition in the ActorSystem configuration.
Look up an executor definition in the ActorSystem configuration. ExecutorServices created in this fashion will be shut down when the ActorSystem terminates.
-
final
case class
DispatcherFromExecutionContext
(ec: ExecutionContext, next: DeploymentConfig = EmptyDeploymentConfig) extends DeploymentConfig with DispatcherSelector with Product with Serializable
Directly use the given ExecutionContext whenever the actor needs to be run.
Directly use the given ExecutionContext whenever the actor needs to be run. No attempt will be made to shut down this thread pool, even if it is an instance of ExecutorService.
-
final
case class
DispatcherFromExecutor
(executor: Executor, next: DeploymentConfig = EmptyDeploymentConfig) extends DeploymentConfig with DispatcherSelector with Product with Serializable
Directly use the given Executor whenever the actor needs to be run.
Directly use the given Executor whenever the actor needs to be run. No attempt will be made to shut down this thread pool, even if it is an instance of ExecutorService.
-
sealed
trait
DispatcherSelector
extends DeploymentConfig
Subclasses of this type describe which thread pool shall be used to run the actor to which this configuration is applied.
Subclasses of this type describe which thread pool shall be used to run the actor to which this configuration is applied.
The default configuration if none of these options are present is to run the actor on the same executor as its parent.
-
abstract
class
Dispatchers
extends AnyRef
An ActorSystem looks up all its thread pools via a Dispatchers instance.
-
final
case class
Dropped
(msg: Any, recipient: ActorRef[Nothing]) extends Product with Serializable
Envelope that is published on the eventStream for every message that is dropped due to overfull queues.
-
abstract
class
Effect
extends AnyRef
All tracked effects must extend implement this type.
All tracked effects must extend implement this type. It is deliberately not sealed in order to allow extensions.
-
class
EffectfulActorContext
[T] extends StubbedActorContext[T]
An ActorContext for testing purposes that records the effects performed on it and otherwise stubs them out like a StubbedActorContext.
-
trait
EventStream
extends AnyRef
An EventStream allows local actors to register for certain message types, including their subtypes automatically.
An EventStream allows local actors to register for certain message types, including their subtypes automatically. Publishing events will broadcast them to all currently subscribed actors with matching subscriptions for the event type.
IMPORTANT NOTICE
This EventStream is local to the ActorSystem, it does not span a cluster. For disseminating messages across a cluster please refer to the DistributedPubSub module.
- class Inbox [T] extends AnyRef
- abstract class Logger extends AnyRef
-
final
case class
MailboxCapacity
(capacity: Int, next: DeploymentConfig = EmptyDeploymentConfig) extends DeploymentConfig with Product with Serializable
Configure the maximum mailbox capacity for the actor.
Configure the maximum mailbox capacity for the actor. If more messages are enqueued because the actor does not process them quickly enough then further messages will be dropped.
The default mailbox capacity that is used when this option is not given is taken from the
akka.typed.mailbox-capacity
configuration setting. -
final
class
Settings
extends AnyRef
The configuration settings that were parsed from the config by an ActorSystem.
The configuration settings that were parsed from the config by an ActorSystem. This class is immutable.
-
sealed
trait
Signal
extends AnyRef
System signals are notifications that are generated by the system and delivered to the Actor behavior in a reliable fashion (i.e.
System signals are notifications that are generated by the system and delivered to the Actor behavior in a reliable fashion (i.e. they are guaranteed to arrive in contrast to the at-most-once semantics of normal Actor messages).
-
class
StubbedActorContext
[T] extends ActorContext[T]
An ActorContext for synchronous execution of a Behavior that provides only stubs for the effects an Actor can perform and replaces created child Actors by a synchronous Inbox (see
Inbox.sync
).An ActorContext for synchronous execution of a Behavior that provides only stubs for the effects an Actor can perform and replaces created child Actors by a synchronous Inbox (see
Inbox.sync
).See EffectfulActorContext for more advanced uses.
-
final
case class
Terminated
(ref: ActorRef[Nothing])(failed: Throwable) extends Signal with Product with Serializable
Lifecycle signal that is fired when an Actor that was watched has terminated.
Lifecycle signal that is fired when an Actor that was watched has terminated. Watching is performed by invoking the akka.typed.ActorContext
watch
method. The DeathWatch service is idempotent, meaning that registering twice has the same effect as registering once. Registration does not need to happen before the Actor terminates, a notification is guaranteed to arrive after both registration and termination have occurred. Termination of a remote Actor can also be effected by declaring the Actor’s home system as failed (e.g. as a result of being unreachable).- Annotations
- @SerialVersionUID()
Value Members
- object ActorRef
- object ActorSystem
-
object
AskPattern
The ask-pattern implements the initiator side of a request–reply protocol.
The ask-pattern implements the initiator side of a request–reply protocol. The party that asks may be within or without an Actor, since the implementation will fabricate a (hidden) ActorRef that is bound to a scala.concurrent.Promise. This ActorRef will need to be injected in the message that is sent to the target Actor in order to function as a reply-to address, therefore the argument to the ask /
?
operator is not the message itself but a function that given the reply-to address will create the message.case class Request(msg: String, replyTo: ActorRef[Reply]) case class Reply(msg: String) implicit val timeout = Timeout(3.seconds) val target: ActorRef[Request] = ... val f: Future[Reply] = target ? (Request("hello", _))
- object Behavior
- object DispatcherDefault extends Serializable
- object Dispatchers
- object Effect
-
object
EmptyDeploymentConfig
extends DeploymentConfig with Product with Serializable
The empty configuration node, used as a terminator for the internally linked list of each DeploymentConfig.
-
object
Failed
FIXME correct this documentation when the Restarter behavior has been implemented
FIXME correct this documentation when the Restarter behavior has been implemented
The parent of an actor decides upon the fate of a failed child actor by encapsulating its next behavior in one of the four wrappers defined within this class.
Failure responses have an associated precedence that ranks them, which is in descending importance:
- Escalate
- Stop
- Restart
- Resume
- object Inbox
- object Logger
-
object
PostStop
extends Signal with Product with Serializable
Lifecycle signal that is fired after this actor and all its child actors (transitively) have terminated.
Lifecycle signal that is fired after this actor and all its child actors (transitively) have terminated. The Terminated signal is only sent to registered watchers after this signal has been processed.
IMPORTANT NOTE: if the actor terminated by switching to the
Stopped
behavior then this signal will be ignored (i.e. the Stopped behavior will do nothing in reaction to it).- Annotations
- @SerialVersionUID()
-
object
PreRestart
extends Signal with Product with Serializable
Lifecycle signal that is fired upon restart of the Actor before replacing the behavior with the fresh one (i.e.
Lifecycle signal that is fired upon restart of the Actor before replacing the behavior with the fresh one (i.e. this signal is received within the behavior that failed).
- Annotations
- @SerialVersionUID()
-
object
PreStart
extends Signal with Product with Serializable
Lifecycle signal that is fired upon creation of the Actor.
Lifecycle signal that is fired upon creation of the Actor. This will be the first message that the actor processes.
- Annotations
- @SerialVersionUID()
-
object
ScalaDSL
This object holds several behavior factories and combinators that can be used to construct Behavior instances.