SupervisionStrategy
in package
Read onlyYes
FinalYes
Tags
Table of Contents
Properties
- $decider : Closure
- $initialBackoff : Duration
- $maxBackoff : Duration
- $maxRetries : int
- $multiplier : float
- $type : StrategyType
- $window : Duration
Methods
- allForOne() : self
- All-for-one strategy: all children are acted upon when one fails.
- decide() : Directive
- Invoke the decider to determine the directive for the given exception.
- exponentialBackoff() : self
- Exponential backoff strategy: restarts with increasing delays.
- oneForOne() : self
- One-for-one strategy: only the failed child is acted upon.
Properties
$decider
public
Closure
$decider
$initialBackoff
public
Duration
$initialBackoff
$maxBackoff
public
Duration
$maxBackoff
$maxRetries
public
int
$maxRetries
$multiplier
public
float
$multiplier
$type
public
StrategyType
$type
$window
public
Duration
$window
Methods
allForOne()
All-for-one strategy: all children are acted upon when one fails.
public
static allForOne([int $maxRetries = 3 ][, Duration|null $window = null ][, callable(Throwable): Directive|null $decider = null ]) : self
Parameters
- $maxRetries : int = 3
- $window : Duration|null = null
- $decider : callable(Throwable): Directive|null = null
Return values
selfdecide()
Invoke the decider to determine the directive for the given exception.
public
decide(Throwable $exception) : Directive
Parameters
- $exception : Throwable
Return values
DirectiveexponentialBackoff()
Exponential backoff strategy: restarts with increasing delays.
public
static exponentialBackoff(Duration $initialBackoff, Duration $maxBackoff[, int $maxRetries = 3 ][, float $multiplier = 2.0 ][, callable(Throwable): Directive|null $decider = null ]) : self
Parameters
- $initialBackoff : Duration
- $maxBackoff : Duration
- $maxRetries : int = 3
- $multiplier : float = 2.0
- $decider : callable(Throwable): Directive|null = null
Return values
selfoneForOne()
One-for-one strategy: only the failed child is acted upon.
public
static oneForOne([int $maxRetries = 3 ][, Duration|null $window = null ][, callable(Throwable): Directive|null $decider = null ]) : self
Parameters
- $maxRetries : int = 3
- $window : Duration|null = null
- $decider : callable(Throwable): Directive|null = null