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.
Companion object for Retrier
, containing extension methods for actor Receive
actions.
Companion object for Retrier
, containing extension methods for actor Receive
actions.
(Since version 2017/07/13) This will be removed in a future version
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