Package

akka

typed

Permalink

package typed

Content Hierarchy Learn more about scaladoc diagrams
Visibility
  1. Public
  2. All

Type Members

  1. trait ActorContext[T] extends AnyRef

    Permalink

    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 ! or tell 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.

  2. abstract class ActorRef[-T] extends Comparable[ActorRef[Any]]

    Permalink

    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).

  3. abstract class ActorSystem[-T] extends ActorRef[T]

    Permalink

    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.

  4. abstract class Behavior[T] extends AnyRef

    Permalink

    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.

  5. abstract class Effect extends AnyRef

    Permalink

    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.

  6. class EffectfulActorContext[T] extends StubbedActorContext[T]

    Permalink

    An ActorContext for testing purposes that records the effects performed on it and otherwise stubs them out like a StubbedActorContext.

  7. final case class Failed(cause: Throwable, child: ActorRef[Nothing]) extends Signal with Product with Serializable

    Permalink

    Lifecycle signal that is fired when a direct child actor fails.

    Lifecycle signal that is fired when a direct child actor fails. The child actor will be suspended until its fate has been decided. The decision is communicated by calling the Failed#decide method. If this is not done then the default behavior is to escalate the failure, which amounts to failing this actor with the same exception that the child actor failed with.

    Annotations
    @SerialVersionUID()
  8. final case class PostRestart(failure: Throwable) extends Signal with Product with Serializable

    Permalink

    Lifecycle signal that is fired upon restart of the Actor after replacing the behavior with the fresh one (i.e.

    Lifecycle signal that is fired upon restart of the Actor after replacing the behavior with the fresh one (i.e. this signal is received within the fresh replacement behavior).

    Annotations
    @SerialVersionUID()
  9. final case class PreRestart(failure: Throwable) extends Signal with Product with Serializable

    Permalink

    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()
  10. final case class Props[T](creator: () ⇒ Behavior[T], deploy: Deploy) extends Product with Serializable

    Permalink

    Props describe how to dress up a Behavior so that it can become an Actor.

    Props describe how to dress up a Behavior so that it can become an Actor.

    Annotations
    @SerialVersionUID()
  11. trait ScalaActorRef[-T] extends AnyRef

    Permalink

    This trait is used to hide the ! method from Java code.

  12. sealed trait Signal extends AnyRef

    Permalink

    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).

  13. class StubbedActorContext[T] extends ActorContext[T]

    Permalink

    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.

  14. final case class Terminated(ref: ActorRef[Nothing]) extends Signal with Product with Serializable

    Permalink

    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

  1. object ActorRef

    Permalink
  2. object ActorSystem

    Permalink
  3. object AskPattern

    Permalink

    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", _))
  4. object Behavior

    Permalink
  5. object Effect

    Permalink
  6. object Failed extends Serializable

    Permalink

    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.

    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
  7. object Inbox

    Permalink
  8. object Ops

    Permalink

    Import the contents of this object to retrofit the typed APIs onto the untyped akka.actor.ActorSystem, akka.actor.ActorContext and akka.actor.ActorRef.

  9. object PostStop extends Signal with Product with Serializable

    Permalink

    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()
  10. object PreStart extends Signal with Product with Serializable

    Permalink

    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()
  11. object Props extends Serializable

    Permalink

    Props describe how to dress up a Behavior so that it can become an Actor.

  12. object ReceiveTimeout extends Signal with Product with Serializable

    Permalink

    The actor can register for a notification in case no message is received within a given time window, and the signal that is raised in this case is this one.

    The actor can register for a notification in case no message is received within a given time window, and the signal that is raised in this case is this one. See also ActorContext#setReceiveTimeout.

    Annotations
    @SerialVersionUID()
  13. object ScalaDSL

    Permalink

    This object holds several behavior factories and combinators that can be used to construct Behavior instances.

  14. package patterns

    Permalink

Ungrouped