public interface FastFailoverSupport
extends akka.actor.Actor
Simply mix this trait into your actor for transparent handling of fast failover envelopes and heartbeats.
Note that this uses Akka's aroundReceive and aroundPreRestart methods, which may conflict with other actor
mix-ins like PersistentActor. In such cases it may be better to use FastFailoverHelper directly.
| Modifier and Type | Method and Description |
|---|---|
FastFailoverSettings |
_fastFailoverSettings() |
void |
aroundPreRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message) |
void |
aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
java.lang.Object msg) |
void |
drainHeldMessages()
Drain the held messages buffer.
|
FastFailoverSettings |
fastFailoverSettings()
Fast failover settings.
|
FastFailoverHelper |
helper() |
boolean |
shouldHoldUntilNoOperation(java.lang.Object msg)
Any message that this returns true for will be held by the fast failover support as long as there is an
outstanding fast failover message to process.
|
void |
super$aroundPreRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message) |
void |
super$aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
java.lang.Object msg)
Drain the held messages buffer.
|
FastFailoverSettings _fastFailoverSettings()
void aroundPreRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message)
aroundPreRestart in interface akka.actor.Actorvoid aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
java.lang.Object msg)
aroundReceive in interface akka.actor.Actorvoid drainHeldMessages()
This is invoked when the actor is restarted to ensure any held messages are not lost. If this behaviour is not desired, and instead the messages should be dropped, then this method can be overridden to do nothing.
FastFailoverSettings fastFailoverSettings()
Override if you want to supply your own custom settings.
FastFailoverHelper helper()
boolean shouldHoldUntilNoOperation(java.lang.Object msg)
This is useful for implementing graceful shutdown, to block the processing of shutdown messages until all fast failover operations have completed. Note that if more operations continue to arrive, such that this actor never ends up with no active operations, then the messages could end up being held indefinitely.
Messages that get held must be tolerant to reordering, since other messages may arrive during the time that the messages are being held, which will overtake the held messages.
msg - (undocumented)void super$aroundPreRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message)
void super$aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
java.lang.Object msg)
This is invoked when the actor is restarted to ensure any held messages are not lost. If this behaviour is not desired, and instead the messages should be dropped, then this method can be overridden to do nothing.
receive - (undocumented)msg - (undocumented)