package pattern

  1. Alphabetic
  1. Public
  2. All

Type Members

  1. trait Aggregator extends AnyRef

    The aggregator is to be mixed into an actor for the aggregator behavior.

  2. trait ReceivePipeline extends Actor

    Trait implementing Receive Pipeline Pattern.

    Trait implementing Receive Pipeline Pattern. Mixin this trait for configuring a chain of interceptors to be applied around Actor's current behavior.

  3. class ReliableProxy extends Actor with LoggingFSM[State, Vector[Message]] with ReliableProxyDebugLogging

    A ReliableProxy is a means to wrap a remote actor reference in order to obtain certain improved delivery guarantees:

    A ReliableProxy is a means to wrap a remote actor reference in order to obtain certain improved delivery guarantees:

    • as long as the proxy is not terminated before it sends all of its queued messages then no messages will be lost
    • messages re-sent due to the first point will not be delivered out-of-order, message ordering is preserved

    These guarantees are valid for the communication between the two end-points of the reliable “tunnel”, which usually spans an unreliable network.

    Note that the ReliableProxy guarantees at-least-once, not exactly-once, delivery.

    Delivery from the remote end-point to the target actor is still subject to in-JVM delivery semantics (i.e. not strictly guaranteed due to possible OutOfMemory situations or other VM errors).

    You can create a reliable connection like this:

    In Scala:

    val proxy = context.actorOf(ReliableProxy.props(target, 100.millis, 120.seconds)

    or in Java:

    final ActorRef proxy = getContext().actorOf(ReliableProxy.props(
      target, Duration.create(100, "millis"), Duration.create(120, "seconds")));

    Please note: the tunnel is uni-directional, and original sender information is retained, hence replies by the wrapped target reference will go back in the normal “unreliable” way unless also secured by a ReliableProxy from the remote end.

    Message Types

    This actor is an, hence it offers the service of transition callbacks to those actors which subscribe using the SubscribeTransitionCallBack and UnsubscribeTransitionCallBack messages; see for more documentation. The proxy will transition into ReliableProxy.Active state when ACKs are outstanding and return to the ReliableProxy.Idle state when every message send so far has been confirmed by the peer end-point.

    The initial state of the proxy is ReliableProxy.Connecting. In this state the proxy will repeatedly send messages to ActorSelection(targetPath) in order to obtain a new ActorRef for the target. When an for the target is received a new tunnel will be created, a ReliableProxy.TargetChanged message containing the target ActorRef will be sent to the proxy's transition subscribers and the proxy will transition into either the ReliableProxy.Idle or ReliableProxy.Active state, depending if there are any outstanding messages that need to be delivered. If maxConnectAttempts is defined this actor will stop itself after Identify is sent maxConnectAttempts times.

    While in the Idle or Active states, if a communication failure causes the tunnel to terminate via Remote Deathwatch the proxy will transition into the ReliableProxy.Connecting state as described above. After reconnecting TargetChanged will be sent only if the target ActorRef has changed.

    If this actor is stopped and it still has outstanding messages a ReliableProxy.ProxyTerminated message will be sent to the transition subscribers. It contains an Unsent object with the outstanding messages.

    If an ReliableProxy.Unsent message is sent to this actor the messages contained within it will be relayed through the tunnel to the target.

    Any other message type sent to this actor will be delivered via a remote-deployed child actor to the designated target.

    Failure Cases

    All failures of either the local or the remote end-point are escalated to the parent of this actor; there are no specific error cases which are predefined.


    See the constructor below for the arguments for this actor. However, prefer using akka.contrib.pattern.ReliableProxy#props to this actor's constructor.

  4. class WorkList [T] extends AnyRef

    Fast, small, and dirty implementation of a linked list that removes transient work entries once they are processed.

    Fast, small, and dirty implementation of a linked list that removes transient work entries once they are processed. The list is not thread safe! However it is expected to be reentrant. This means a processing function can add/remove entries from the list while processing. Most important, a processing function can remove its own entry from the list. The first remove must return true and any subsequent removes must return false.

Value Members

  1. object ReceivePipeline
  2. object ReliableProxy
  3. object WorkList

    Provides the utility methods and constructors to the WorkList class.