Package akka.actor.typed
Class SupervisorStrategy.Backoff
- java.lang.Object
-
- akka.actor.typed.SupervisorStrategy
-
- akka.actor.typed.BackoffSupervisorStrategy
-
- akka.actor.typed.SupervisorStrategy.Backoff
-
- All Implemented Interfaces:
SupervisorStrategy.RestartOrBackoff
,java.io.Serializable
,scala.Equals
,scala.Product
,scala.Serializable
- Enclosing class:
- SupervisorStrategy
public static final class SupervisorStrategy.Backoff extends BackoffSupervisorStrategy implements SupervisorStrategy.RestartOrBackoff, scala.Product, scala.Serializable
- See Also:
- Serialized Form
-
-
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 Backoff(scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.concurrent.duration.FiniteDuration resetBackoffAfter, boolean loggingEnabled, int maxRestarts, boolean stopChildren, int stashCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canEqual(java.lang.Object x$1)
SupervisorStrategy.Backoff
copy(scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.concurrent.duration.FiniteDuration resetBackoffAfter, boolean loggingEnabled, int maxRestarts, boolean stopChildren, int stashCapacity)
scala.concurrent.duration.FiniteDuration
copy$default$1()
scala.concurrent.duration.FiniteDuration
copy$default$2()
double
copy$default$3()
scala.concurrent.duration.FiniteDuration
copy$default$4()
boolean
copy$default$5()
int
copy$default$6()
boolean
copy$default$7()
int
copy$default$8()
boolean
equals(java.lang.Object x$1)
java.time.Duration
getResetBackoffAfter()
int
hashCode()
boolean
loggingEnabled()
scala.concurrent.duration.FiniteDuration
maxBackoff()
int
maxRestarts()
scala.concurrent.duration.FiniteDuration
minBackoff()
int
productArity()
java.lang.Object
productElement(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
double
randomFactor()
scala.concurrent.duration.FiniteDuration
resetBackoffAfter()
int
stashCapacity()
boolean
stopChildren()
java.lang.String
toString()
BackoffSupervisorStrategy
withLoggingEnabled(boolean enabled)
BackoffSupervisorStrategy
withMaxRestarts(int maxRestarts)
Allow at most this number of failed restarts in a row.BackoffSupervisorStrategy
withResetBackoffAfter(java.time.Duration timeout)
Java API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
.BackoffSupervisorStrategy
withResetBackoffAfter(scala.concurrent.duration.FiniteDuration timeout)
Scala API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
.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.BackoffSupervisorStrategy
withStopChildren(boolean enabled)
Stop or keep child actors when the parent actor is restarted.-
Methods inherited from class akka.actor.typed.SupervisorStrategy
restart, restartWithBackoff, restartWithBackoff, resume, stop
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface akka.actor.typed.SupervisorStrategy.RestartOrBackoff
unlimitedRestarts
-
-
-
-
Constructor Detail
-
Backoff
public Backoff(scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.concurrent.duration.FiniteDuration resetBackoffAfter, boolean loggingEnabled, int maxRestarts, boolean stopChildren, int stashCapacity)
-
-
Method Detail
-
minBackoff
public scala.concurrent.duration.FiniteDuration minBackoff()
-
maxBackoff
public scala.concurrent.duration.FiniteDuration maxBackoff()
-
randomFactor
public double randomFactor()
-
resetBackoffAfter
public scala.concurrent.duration.FiniteDuration resetBackoffAfter()
- Specified by:
resetBackoffAfter
in classBackoffSupervisorStrategy
-
loggingEnabled
public boolean loggingEnabled()
- Specified by:
loggingEnabled
in interfaceSupervisorStrategy.RestartOrBackoff
- Specified by:
loggingEnabled
in classSupervisorStrategy
-
maxRestarts
public int maxRestarts()
- Specified by:
maxRestarts
in interfaceSupervisorStrategy.RestartOrBackoff
-
stopChildren
public boolean stopChildren()
- Specified by:
stopChildren
in interfaceSupervisorStrategy.RestartOrBackoff
-
stashCapacity
public int stashCapacity()
- Specified by:
stashCapacity
in interfaceSupervisorStrategy.RestartOrBackoff
-
withResetBackoffAfter
public BackoffSupervisorStrategy withResetBackoffAfter(scala.concurrent.duration.FiniteDuration timeout)
Description copied from class:BackoffSupervisorStrategy
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
.- Specified by:
withResetBackoffAfter
in classBackoffSupervisorStrategy
- Parameters:
timeout
- (undocumented)- Returns:
- (undocumented)
-
withResetBackoffAfter
public BackoffSupervisorStrategy withResetBackoffAfter(java.time.Duration timeout)
Description copied from class:BackoffSupervisorStrategy
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
.- Specified by:
withResetBackoffAfter
in classBackoffSupervisorStrategy
- Parameters:
timeout
- (undocumented)- Returns:
- (undocumented)
-
getResetBackoffAfter
public java.time.Duration getResetBackoffAfter()
- Specified by:
getResetBackoffAfter
in classBackoffSupervisorStrategy
-
withMaxRestarts
public BackoffSupervisorStrategy withMaxRestarts(int maxRestarts)
Description copied from class:BackoffSupervisorStrategy
Allow at most this number of failed restarts in a row. Zero or negative disables the upper limit on restarts (and is the default)- Specified by:
withMaxRestarts
in classBackoffSupervisorStrategy
- Parameters:
maxRestarts
- (undocumented)- Returns:
- (undocumented)
-
withStopChildren
public BackoffSupervisorStrategy withStopChildren(boolean enabled)
Description copied from class:BackoffSupervisorStrategy
Stop or keep child actors when the parent actor is restarted. By default child actors are stopped when parent is restarted.- Specified by:
withStopChildren
in classBackoffSupervisorStrategy
- Parameters:
enabled
- iftrue
then child actors are stopped, otherwise they are kept- Returns:
- (undocumented)
-
withStashCapacity
public BackoffSupervisorStrategy withStashCapacity(int capacity)
Description copied from class:BackoffSupervisorStrategy
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
.- Specified by:
withStashCapacity
in classBackoffSupervisorStrategy
- Parameters:
capacity
- (undocumented)- Returns:
- (undocumented)
-
withLoggingEnabled
public BackoffSupervisorStrategy withLoggingEnabled(boolean enabled)
- Specified by:
withLoggingEnabled
in classBackoffSupervisorStrategy
-
copy
public SupervisorStrategy.Backoff copy(scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.concurrent.duration.FiniteDuration resetBackoffAfter, boolean loggingEnabled, int maxRestarts, boolean stopChildren, int stashCapacity)
-
copy$default$1
public scala.concurrent.duration.FiniteDuration copy$default$1()
-
copy$default$2
public scala.concurrent.duration.FiniteDuration copy$default$2()
-
copy$default$3
public double copy$default$3()
-
copy$default$4
public scala.concurrent.duration.FiniteDuration copy$default$4()
-
copy$default$5
public boolean copy$default$5()
-
copy$default$6
public int copy$default$6()
-
copy$default$7
public boolean copy$default$7()
-
copy$default$8
public int copy$default$8()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-