object SupervisorStrategy
- Source
- SupervisorStrategy.scala
- Alphabetic
- By Inheritance
- SupervisorStrategy
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
val
restart: RestartSupervisorStrategy
Restart immediately without any limit on number of restart retries.
Restart immediately without any limit on number of restart retries. A limit can be added with RestartSupervisorStrategy.withLimit.
If the actor behavior is deferred and throws an exception on startup the actor is stopped (restarting would be dangerous as it could lead to an infinite restart-loop)
-
def
restartWithBackoff(minBackoff: Duration, maxBackoff: Duration, randomFactor: Double): BackoffSupervisorStrategy
Java API: It supports exponential back-off between the given
minBackoff
andmaxBackoff
durations.Java API: It supports exponential back-off between the given
minBackoff
andmaxBackoff
durations. For example, ifminBackoff
is 3 seconds andmaxBackoff
30 seconds the start attempts will be delayed with 3, 6, 12, 24, 30, 30 seconds. The exponential back-off counter is reset if the actor is not terminated within theminBackoff
duration.In addition to the calculated exponential back-off an additional random delay based the given
randomFactor
is added, e.g. 0.2 adds up to 20% delay. The reason for adding a random delay is to avoid that all failing actors hit the backend resource at the same time.During the back-off incoming messages are dropped.
If no new exception occurs within the
minBackoff
duration the exponentially increased back-off timeout is reset.The strategy is applied also if the actor behavior is deferred and throws an exception during startup.
- minBackoff
minimum (initial) duration until the child actor will started again, if it is terminated
- maxBackoff
the exponential back-off is capped to this duration
- randomFactor
after calculation of the exponential back-off an additional random delay based on this factor is added, e.g.
0.2
adds up to20%
delay. In order to skip this additional delay pass in0
.
-
def
restartWithBackoff(minBackoff: FiniteDuration, maxBackoff: FiniteDuration, randomFactor: Double): BackoffSupervisorStrategy
Scala API: It supports exponential back-off between the given
minBackoff
andmaxBackoff
durations.Scala API: It supports exponential back-off between the given
minBackoff
andmaxBackoff
durations. For example, ifminBackoff
is 3 seconds andmaxBackoff
30 seconds the start attempts will be delayed with 3, 6, 12, 24, 30, 30 seconds. The exponential back-off counter is reset if the actor is not terminated within theminBackoff
duration.In addition to the calculated exponential back-off an additional random delay based the given
randomFactor
is added, e.g. 0.2 adds up to 20% delay. The reason for adding a random delay is to avoid that all failing actors hit the backend resource at the same time.During the back-off incoming messages are dropped.
If no new exception occurs within the
minBackoff
duration the exponentially increased back-off timeout is reset.The strategy is applied also if the actor behavior is deferred and throws an exception during startup.
A maximum number of restarts can be specified with Backoff#withMaxRestarts
- minBackoff
minimum (initial) duration until the child actor will started again, if it is terminated
- maxBackoff
the exponential back-off is capped to this duration
- randomFactor
after calculation of the exponential back-off an additional random delay based on this factor is added, e.g.
0.2
adds up to20%
delay. In order to skip this additional delay pass in0
.
-
val
resume: SupervisorStrategy
Resume means keeping the same state as before the exception was thrown and is thus less safe than
restart
.Resume means keeping the same state as before the exception was thrown and is thus less safe than
restart
.If the actor behavior is deferred and throws an exception on startup the actor is stopped (restarting would be dangerous as it could lead to an infinite restart-loop)
-
val
stop: SupervisorStrategy
Stop the actor
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )