Nexus API Reference

SupervisionStrategy
in package

Read onlyYes
FinalYes
Tags
psalm-api

Immutable supervision strategy configuration.

Created via named constructors: oneForOne(), allForOne(), exponentialBackoff().

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

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
self

decide()

Invoke the decider to determine the directive for the given exception.

public decide(Throwable $exception) : Directive
Parameters
$exception : Throwable
Return values
Directive

exponentialBackoff()

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
self

oneForOne()

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
Return values
self

        
On this page

Search results