Documentation

RetryOnFailure
in package

FinalYes

The RetryOnFailure attribute.

Annotate your methods with the RetryOnFailure attribute and, in case of exception in the method, its execution will be repeated a few times.

Attributes
#[Attribute]
\Attribute::TARGET_METHOD

Table of Contents

Properties

$retryFor  : array<string|int, mixed>
$sleepMilliseconds  : Closure|int
$times  : array<string|int, mixed>|int

Methods

__construct()  : mixed
Create a new instance.

Properties

$retryFor read-only

public array<string|int, mixed> $retryFor = []

$sleepMilliseconds read-only

public Closure|int $sleepMilliseconds = 0

Methods

__construct()

Create a new instance.

public __construct(int<1, max>|array<int, int<0, max>> $times[, Closure|int<0, max> $sleepMilliseconds = 0 ][, array<int, Throwable>$retryFor = [] ]) : mixed
Parameters
$times : int<1, max>|array<int, int<0, max>>

The number of times to retry

$sleepMilliseconds : Closure|int<0, max> = 0

The number of milliseconds to sleep between retries

$retryFor : array<int, Throwable>> = []

The exception types that should cause a retry


        
On this page

Search results