a function that extracts a key out of a sent message
a function that extracts a key out of an acknowledgement message
a function that defines which messages of type Ack
should be considered
acknowledgments
a function that defines if a message should be retried or not
the retry delay
an optional timeout
the actor context
the actor for which this Retrier
was created
Acknowledges immediately all messages sent to an actor.
Acknowledges immediately all messages sent to an actor.
the destination of the messages to be acknowledged
Dispatches a set of messages to their destinations as a batch.
Dispatches a set of messages to their destinations as a batch. The onComplete
method will
only be called once all sent messages are acknowledged. Retries are executed per message; a
timeout ceases all retries in the batch and causes the onFailure
method to fire.
the request that triggered this dispatch. Used only for identifying this batch
when the onComplete
and onFailure
methods are called.
the set of messages to sent and respective destinations
Dispatches a single message.
Dispatches a single message. The onComplete
method will be called once all the message is
acknowledged. If a timeout occurs, onFailure
method is fired.
the request that triggered this dispatch. Used only for identifying this batch
when the onComplete
and onFailure
methods are called.
the message to send
the destination of the message
Hook executed when a timeout occurs in a message or group of messages.
Hook executed when a timeout occurs in a message or group of messages.
the triggering request
Augments a Receive
action with retry-specific message handling.
Augments a Receive
action with retry-specific message handling.
the Receive
action to augment
a new Receive
capable of handling retry-specific messages.
Helper class for actors that need to retry some of the messages they send to other actors until a certain acknowledgement message (ACK) is received. Messages can be sent individually or in batches.
This class is instantiated by providing functions that extract an identifier from sent messages and from ACK messages. This can be an arbitrary identifier, as long as it uniquely associates a received ACK with the original sent message. Optional per-message filtering functions can be given, as well as the frequency of the retries and an optional timeout. Finally, the
onComplete
method, which is executed after a message or group of messages is acknowledged, must be implemented.A
Retrier
can be used as follows:In the previous example, every time a
Master
actor receives aChangeData
message, it sends aReplicate
message to a replica actor and only responds to the original sender after an acknowledgement from the replica is received. TheReplicate
message is retried periodically.the type of the triggering request
the type of the messages to be sent and retried
the type of the ACK messages
the type of identifier or object that links a sent message to its ACK
(Since version 2017/07/13) This will be removed in a future version