public class BackoffSupervisor$
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static BackoffSupervisor$ |
MODULE$
Static reference to the singleton instance of this Scala object.
|
Constructor and Description |
---|
BackoffSupervisor$() |
Modifier and Type | Method and Description |
---|---|
scala.concurrent.duration.FiniteDuration |
calculateDelay(int restartCount,
scala.concurrent.duration.FiniteDuration minBackoff,
scala.concurrent.duration.FiniteDuration maxBackoff,
double randomFactor)
INTERNAL API
|
BackoffSupervisor.GetCurrentChild$ |
getCurrentChild()
Java API: Send this message to the
BackoffSupervisor and it will reply with
BackoffSupervisor.CurrentChild containing the ActorRef of the current child, if any. |
BackoffSupervisor.GetRestartCount$ |
getRestartCount()
Java API: Send this message to the
BackoffSupervisor and it will reply with
BackoffSupervisor.RestartCount containing the current restart count. |
Props |
props(BackoffOptions options)
Props for creating a
BackoffSupervisor actor from BackoffOptions . |
Props |
props(Props childProps,
java.lang.String childName,
scala.concurrent.duration.FiniteDuration minBackoff,
scala.concurrent.duration.FiniteDuration maxBackoff,
double randomFactor)
Props for creating a
BackoffSupervisor actor. |
Props |
propsWithSupervisorStrategy(Props childProps,
java.lang.String childName,
scala.concurrent.duration.FiniteDuration minBackoff,
scala.concurrent.duration.FiniteDuration maxBackoff,
double randomFactor,
SupervisorStrategy strategy)
Props for creating a
BackoffSupervisor actor with a custom
supervision strategy. |
BackoffSupervisor.Reset$ |
reset()
Java API: Send this message to the
BackoffSupervisor and it will reset the back-off. |
public static final BackoffSupervisor$ MODULE$
public Props props(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor)
BackoffSupervisor
actor.
Exceptions in the child are handled with the default supervision strategy, i.e.
most exceptions will immediately restart the child. You can define another
supervision strategy by using propsWithSupervisorStrategy(akka.actor.Props, java.lang.String, scala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, double, akka.actor.SupervisorStrategy)
.
childProps
- the Props
of the child actor that
will be started and supervisedchildName
- name of the child actorminBackoff
- minimum (initial) duration until the child actor will
started again, if it is terminatedmaxBackoff
- the exponential back-off is capped to this durationrandomFactor
- after calculation of the exponential back-off an additional
random delay based on this factor is added, e.g. 0.2
adds up to 20%
delay.
In order to skip this additional delay pass in 0
.public Props propsWithSupervisorStrategy(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, SupervisorStrategy strategy)
BackoffSupervisor
actor with a custom
supervision strategy.
Exceptions in the child are handled with the given supervisionStrategy
. A
Restart
will perform a normal immediate restart of the child. A Stop
will
stop the child, but it will be started again after the back-off duration.
childProps
- the Props
of the child actor that
will be started and supervisedchildName
- name of the child actorminBackoff
- minimum (initial) duration until the child actor will
started again, if it is terminatedmaxBackoff
- the exponential back-off is capped to this durationrandomFactor
- after calculation of the exponential back-off an additional
random delay based on this factor is added, e.g. 0.2
adds up to 20%
delay.
In order to skip this additional delay pass in 0
.strategy
- the supervision strategy to use for handling exceptions
in the childpublic Props props(BackoffOptions options)
BackoffSupervisor
actor from BackoffOptions
.
options
- the BackoffOptions
that specify how to construct a backoff-supervisor.public BackoffSupervisor.GetCurrentChild$ getCurrentChild()
BackoffSupervisor
and it will reply with
BackoffSupervisor.CurrentChild
containing the ActorRef
of the current child, if any.public BackoffSupervisor.Reset$ reset()
BackoffSupervisor
and it will reset the back-off.
This should be used in conjunction with withManualReset
in BackoffOptions
.public BackoffSupervisor.GetRestartCount$ getRestartCount()
BackoffSupervisor
and it will reply with
BackoffSupervisor.RestartCount
containing the current restart count.public scala.concurrent.duration.FiniteDuration calculateDelay(int restartCount, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor)
Calculates an exponential back off delay.
restartCount
- (undocumented)minBackoff
- (undocumented)maxBackoff
- (undocumented)randomFactor
- (undocumented)