Documentation

MultiplierRetryStrategy
in package
implements RetryStrategyInterface

A retry strategy with a constant or exponential retry delay.

For example, if $delayMilliseconds=10000 & $multiplier=1 (default), each retry will wait exactly 10 seconds.

But if $delayMilliseconds=10000 & $multiplier=2: * Retry 1: 10 second delay * Retry 2: 20 second delay (10000 * 2 = 20000) * Retry 3: 40 second delay (20000 * 2 = 40000)

Tags
author

Ryan Weaver ryan@symfonycasts.com

final

Table of Contents

Interfaces

RetryStrategyInterface

Properties

$delayMilliseconds  : int
$maxDelayMilliseconds  : int
$maxRetries  : int
$multiplier  : float

Methods

__construct()  : mixed
getWaitingTime()  : int
isRetryable()  : bool

Properties

Methods

__construct()

public __construct([int $maxRetries = 3 ][, int $delayMilliseconds = 1000 ][, float $multiplier = 1 ][, int $maxDelayMilliseconds = 0 ]) : mixed
Parameters
$maxRetries : int = 3

The maximum number of times to retry

$delayMilliseconds : int = 1000

Amount of time to delay (or the initial value when multiplier is used)

$multiplier : float = 1

Multiplier to apply to the delay each time a retry occurs

$maxDelayMilliseconds : int = 0

Maximum delay to allow (0 means no maximum)

getWaitingTime()

public getWaitingTime(Envelope $message[, Throwable|null $throwable = null ]) : int
Parameters
$message : Envelope
$throwable : Throwable|null = null

The cause of the failed handling

Return values
int

The time to delay/wait in milliseconds

isRetryable()

public isRetryable(Envelope $message[, Throwable|null $throwable = null ]) : bool
Parameters
$message : Envelope
$throwable : Throwable|null = null

The cause of the failed handling

Return values
bool

        
On this page

Search results