Package akka.actor.typed
Class BackoffSupervisorStrategy
- java.lang.Object
-
- akka.actor.typed.SupervisorStrategy
-
- akka.actor.typed.BackoffSupervisorStrategy
-
- Direct Known Subclasses:
SupervisorStrategy.Backoff
public abstract class BackoffSupervisorStrategy extends SupervisorStrategy
Scala API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
. By default, theresetBackoffAfter
has the same value asminBackoff
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.actor.typed.SupervisorStrategy
SupervisorStrategy.Backoff, SupervisorStrategy.Backoff$, SupervisorStrategy.Restart, SupervisorStrategy.Restart$, SupervisorStrategy.RestartOrBackoff, SupervisorStrategy.Resume, SupervisorStrategy.Resume$, SupervisorStrategy.Stop, SupervisorStrategy.Stop$
-
-
Constructor Summary
Constructors Constructor Description BackoffSupervisorStrategy()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.time.Duration
getResetBackoffAfter()
abstract scala.concurrent.duration.FiniteDuration
resetBackoffAfter()
abstract BackoffSupervisorStrategy
withLoggingEnabled(boolean enabled)
abstract BackoffSupervisorStrategy
withMaxRestarts(int maxRestarts)
Allow at most this number of failed restarts in a row.abstract BackoffSupervisorStrategy
withResetBackoffAfter(java.time.Duration timeout)
Java API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
.abstract BackoffSupervisorStrategy
withResetBackoffAfter(scala.concurrent.duration.FiniteDuration timeout)
Scala API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
.abstract BackoffSupervisorStrategy
withStashCapacity(int capacity)
While restarting (waiting for backoff to expire and children to stop) incoming messages and signals are stashed, and delivered later to the newly restarted behavior.abstract BackoffSupervisorStrategy
withStopChildren(boolean enabled)
Stop or keep child actors when the parent actor is restarted.-
Methods inherited from class akka.actor.typed.SupervisorStrategy
loggingEnabled, restart, restartWithBackoff, restartWithBackoff, resume, stop
-
-
-
-
Method Detail
-
getResetBackoffAfter
public abstract java.time.Duration getResetBackoffAfter()
-
resetBackoffAfter
public abstract scala.concurrent.duration.FiniteDuration resetBackoffAfter()
-
withLoggingEnabled
public abstract BackoffSupervisorStrategy withLoggingEnabled(boolean enabled)
- Specified by:
withLoggingEnabled
in classSupervisorStrategy
-
withMaxRestarts
public abstract BackoffSupervisorStrategy withMaxRestarts(int maxRestarts)
Allow at most this number of failed restarts in a row. Zero or negative disables the upper limit on restarts (and is the default)- Parameters:
maxRestarts
- (undocumented)- Returns:
- (undocumented)
-
withResetBackoffAfter
public abstract BackoffSupervisorStrategy withResetBackoffAfter(scala.concurrent.duration.FiniteDuration timeout)
Scala API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
. By default, theresetBackoffAfter
has the same value asminBackoff
.- Parameters:
timeout
- (undocumented)- Returns:
- (undocumented)
-
withResetBackoffAfter
public abstract BackoffSupervisorStrategy withResetBackoffAfter(java.time.Duration timeout)
Java API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
. By default, theresetBackoffAfter
has the same value asminBackoff
.- Parameters:
timeout
- (undocumented)- Returns:
- (undocumented)
-
withStashCapacity
public abstract BackoffSupervisorStrategy withStashCapacity(int capacity)
While restarting (waiting for backoff to expire and children to stop) incoming messages and signals are stashed, and delivered later to the newly restarted behavior. This property defines the capacity in number of messages of the stash buffer. If the capacity is exceed then additional incoming messages are dropped.By default the capacity is defined by config property
akka.actor.typed.restart-stash-capacity
.- Parameters:
capacity
- (undocumented)- Returns:
- (undocumented)
-
withStopChildren
public abstract BackoffSupervisorStrategy withStopChildren(boolean enabled)
Stop or keep child actors when the parent actor is restarted. By default child actors are stopped when parent is restarted.- Parameters:
enabled
- iftrue
then child actors are stopped, otherwise they are kept- Returns:
- (undocumented)
-
-