The aggregator is to be mixed into an actor for the aggregator behavior.
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.
(Since version 2.5.0) Feel free to copy
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:
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.
This actor is an akka.actor.FSM, hence it offers the service of
transition callbacks to those actors which subscribe using the
SubscribeTransitionCallBack
and UnsubscribeTransitionCallBack
messages; see akka.actor.FSM 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 akka.actor.Identify messages to ActorSelection(targetPath)
in order to obtain a new ActorRef
for the target. When an akka.actor.ActorIdentity
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.
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.
(Since version 2.5.0) Use AtLeastOnceDelivery instead
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.
(Since version 2.5.0) Feel free to copy
(Since version 2.5.0) Feel free to copy
(Since version 2.5.0) Use AtLeastOnceDelivery instead
Provides the utility methods and constructors to the WorkList class.
Provides the utility methods and constructors to the WorkList class.
(Since version 2.5.0) Feel free to copy
The aggregator is to be mixed into an actor for the aggregator behavior.
(Since version 2.5.0) Feel free to copy