Class BackoffSupervisor
- java.lang.Object
-
- org.apache.pekko.pattern.internal.BackoffOnStopSupervisor
-
- org.apache.pekko.pattern.BackoffSupervisor
-
public final class BackoffSupervisor extends org.apache.pekko.pattern.internal.BackoffOnStopSupervisor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBackoffSupervisor.CurrentChildSend this message to theBackoffSupervisorand it will reply withBackoffSupervisor.CurrentChildcontaining theActorRefof the current child, if any.static classBackoffSupervisor.CurrentChild$static classBackoffSupervisor.GetCurrentChild$Send this message to theBackoffSupervisorand it will reply withBackoffSupervisor.CurrentChildcontaining theActorRefof the current child, if any.static classBackoffSupervisor.GetRestartCount$Send this message to theBackoffSupervisorand it will reply withBackoffSupervisor.RestartCountcontaining the current restart count.static classBackoffSupervisor.Reset$Send this message to theBackoffSupervisorand it will reset the back-off.static classBackoffSupervisor.ResetRestartCount$static classBackoffSupervisor.RestartCountstatic classBackoffSupervisor.RestartCount$static classBackoffSupervisor.StartChild$INTERNAL API
-
Constructor Summary
Constructors Constructor Description BackoffSupervisor(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor)Deprecated.Use `BackoffSupervisor.props` method instead.BackoffSupervisor(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, SupervisorStrategy supervisorStrategy)Deprecated.Use `BackoffSupervisor.props` method instead.BackoffSupervisor(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, BackoffReset reset, double randomFactor, SupervisorStrategy strategy, scala.Option<java.lang.Object> replyWhileStopped)Deprecated.Use `BackoffSupervisor.props` method instead.BackoffSupervisor(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, BackoffReset reset, double randomFactor, SupervisorStrategy strategy, scala.Option<java.lang.Object> replyWhileStopped, scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage)Deprecated.Use `BackoffSupervisor.props` method instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringchildName()PropschildProps()scala.Option<scala.Function1<java.lang.Object,java.lang.Object>>finalStopMessage()static BackoffSupervisor.GetCurrentChild$getCurrentChild()Java API: Send this message to theBackoffSupervisorand it will reply withBackoffSupervisor.CurrentChildcontaining theActorRefof the current child, if any.static BackoffSupervisor.GetRestartCount$getRestartCount()Java API: Send this message to theBackoffSupervisorand it will reply withBackoffSupervisor.RestartCountcontaining the current restart count.static Propsprops(Props childProps, java.lang.String childName, java.time.Duration minBackoff, java.time.Duration maxBackoff, double randomFactor)Deprecated.Use props with BackoffOpts instead.static Propsprops(Props childProps, java.lang.String childName, java.time.Duration minBackoff, java.time.Duration maxBackoff, double randomFactor, int maxNrOfRetries)Deprecated.Use props with BackoffOpts instead.static Propsprops(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor)Deprecated.Use props with BackoffOpts instead.static Propsprops(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, int maxNrOfRetries)Deprecated.Use props with BackoffOpts instead.static Propsprops(BackoffOnFailureOptions options)Props for creating aBackoffSupervisoractor fromBackoffOnFailureOptions.static Propsprops(BackoffOnStopOptions options)Props for creating aBackoffSupervisoractor fromBackoffOnStopOptions.static Propsprops(BackoffOptions options)Deprecated.Use new API from BackoffOpts object instead.static PropspropsWithSupervisorStrategy(Props childProps, java.lang.String childName, java.time.Duration minBackoff, java.time.Duration maxBackoff, double randomFactor, SupervisorStrategy strategy)Deprecated.Use props with BackoffOpts instead.static PropspropsWithSupervisorStrategy(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, SupervisorStrategy strategy)Deprecated.Use props with BackoffOpts instead.scala.Option<java.lang.Object>replyWhileStopped()BackoffResetreset()
-
-
-
Constructor Detail
-
BackoffSupervisor
public BackoffSupervisor(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, BackoffReset reset, double randomFactor, SupervisorStrategy strategy, scala.Option<java.lang.Object> replyWhileStopped, scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage)
Deprecated.Use `BackoffSupervisor.props` method instead. Since Akka 2.5.22.
-
BackoffSupervisor
public BackoffSupervisor(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, BackoffReset reset, double randomFactor, SupervisorStrategy strategy, scala.Option<java.lang.Object> replyWhileStopped)
Deprecated.Use `BackoffSupervisor.props` method instead. Since Akka 2.5.22.
-
BackoffSupervisor
public BackoffSupervisor(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, SupervisorStrategy supervisorStrategy)
Deprecated.Use `BackoffSupervisor.props` method instead. Since Akka 2.5.22.
-
BackoffSupervisor
public BackoffSupervisor(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor)
Deprecated.Use `BackoffSupervisor.props` method instead. Since Akka 2.5.22.
-
-
Method Detail
-
props
public static Props props(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor)
Deprecated.Use props with BackoffOpts instead. Since Akka 2.5.22.Props for creating aBackoffSupervisoractor.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(org.apache.pekko.actor.Props, java.lang.String, scala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, double, org.apache.pekko.actor.SupervisorStrategy).- Parameters:
childProps- thepekko.actor.Propsof 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.2adds up to20%delay. In order to skip this additional delay pass in0.
-
props
public static Props props(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, int maxNrOfRetries)
Deprecated.Use props with BackoffOpts instead. Since Akka 2.5.22.Props for creating aBackoffSupervisoractor.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(org.apache.pekko.actor.Props, java.lang.String, scala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, double, org.apache.pekko.actor.SupervisorStrategy).- Parameters:
childProps- thepekko.actor.Propsof 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.2adds up to20%delay. In order to skip this additional delay pass in0.maxNrOfRetries- maximum number of attempts to restart the child actor. The supervisor will terminate itself after the maxNoOfRetries is reached. In order to restart infinitely pass in-1.
-
props
public static Props props(Props childProps, java.lang.String childName, java.time.Duration minBackoff, java.time.Duration maxBackoff, double randomFactor)
Deprecated.Use props with BackoffOpts instead. Since Akka 2.5.22.Props for creating aBackoffSupervisoractor.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(org.apache.pekko.actor.Props, java.lang.String, scala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, double, org.apache.pekko.actor.SupervisorStrategy).- Parameters:
childProps- thepekko.actor.Propsof 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.2adds up to20%delay. In order to skip this additional delay pass in0.
-
props
public static Props props(Props childProps, java.lang.String childName, java.time.Duration minBackoff, java.time.Duration maxBackoff, double randomFactor, int maxNrOfRetries)
Deprecated.Use props with BackoffOpts instead. Since Akka 2.5.22.Props for creating aBackoffSupervisoractor.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(org.apache.pekko.actor.Props, java.lang.String, scala.concurrent.duration.FiniteDuration, scala.concurrent.duration.FiniteDuration, double, org.apache.pekko.actor.SupervisorStrategy).- Parameters:
childProps- thepekko.actor.Propsof 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.2adds up to20%delay. In order to skip this additional delay pass in0.maxNrOfRetries- maximum number of attempts to restart the child actor. The supervisor will terminate itself after the maxNoOfRetries is reached. In order to restart infinitely pass in-1.
-
propsWithSupervisorStrategy
public static Props propsWithSupervisorStrategy(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, SupervisorStrategy strategy)
Deprecated.Use props with BackoffOpts instead. Since Akka 2.5.22.Props for creating aBackoffSupervisoractor with a custom supervision strategy.Exceptions in the child are handled with the given
supervisionStrategy. ARestartwill perform a normal immediate restart of the child. AStopwill stop the child, but it will be started again after the back-off duration.- Parameters:
childProps- thepekko.actor.Propsof 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.2adds up to20%delay. In order to skip this additional delay pass in0.strategy- the supervision strategy to use for handling exceptions in the child. As the BackoffSupervisor creates a separate actor to handle the backoff process, only aOneForOneStrategymakes sense here.
-
propsWithSupervisorStrategy
public static Props propsWithSupervisorStrategy(Props childProps, java.lang.String childName, java.time.Duration minBackoff, java.time.Duration maxBackoff, double randomFactor, SupervisorStrategy strategy)
Deprecated.Use props with BackoffOpts instead. Since Akka 2.5.22.Props for creating aBackoffSupervisoractor with a custom supervision strategy.Exceptions in the child are handled with the given
supervisionStrategy. ARestartwill perform a normal immediate restart of the child. AStopwill stop the child, but it will be started again after the back-off duration.- Parameters:
childProps- thepekko.actor.Propsof 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.2adds up to20%delay. In order to skip this additional delay pass in0.strategy- the supervision strategy to use for handling exceptions in the child. As the BackoffSupervisor creates a separate actor to handle the backoff process, only aOneForOneStrategymakes sense here.
-
props
public static Props props(BackoffOptions options)
Deprecated.Use new API from BackoffOpts object instead. Since Akka 2.5.22.Props for creating aBackoffSupervisoractor fromBackoffOptions.- Parameters:
options- theBackoffOptionsthat specify how to construct a backoff-supervisor.
-
props
public static Props props(BackoffOnStopOptions options)
Props for creating aBackoffSupervisoractor fromBackoffOnStopOptions.- Parameters:
options- theBackoffOnStopOptionsthat specify how to construct a backoff-supervisor.
-
props
public static Props props(BackoffOnFailureOptions options)
Props for creating aBackoffSupervisoractor fromBackoffOnFailureOptions.- Parameters:
options- theBackoffOnFailureOptionsthat specify how to construct a backoff-supervisor.
-
getCurrentChild
public static BackoffSupervisor.GetCurrentChild$ getCurrentChild()
Java API: Send this message to theBackoffSupervisorand it will reply withBackoffSupervisor.CurrentChildcontaining theActorRefof the current child, if any.
-
getRestartCount
public static BackoffSupervisor.GetRestartCount$ getRestartCount()
Java API: Send this message to theBackoffSupervisorand it will reply withBackoffSupervisor.RestartCountcontaining the current restart count.
-
childProps
public Props childProps()
-
childName
public java.lang.String childName()
-
reset
public BackoffReset reset()
-
replyWhileStopped
public scala.Option<java.lang.Object> replyWhileStopped()
-
finalStopMessage
public scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage()
-
-