Open Monograph Press  3.3.0
GuzzleHttp\RetryMiddleware Class Reference

Public Member Functions

 __construct (callable $decider, callable $nextHandler, callable $delay=null)
 
 __invoke (RequestInterface $request, array $options)
 

Static Public Member Functions

static exponentialDelay ($retries)
 

Detailed Description

Middleware that retries requests based on the boolean result of invoking the provided "decider" function.

Definition at line 14 of file RetryMiddleware.php.

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\RetryMiddleware::__construct ( callable  $decider,
callable  $nextHandler,
callable  $delay = null 
)
Parameters
callable$deciderFunction that accepts the number of retries, a request, [response], and [exception] and returns true if the request is to be retried.
callable$nextHandlerNext handler to invoke.
callable$delayFunction that accepts the number of retries and [response] and returns the number of milliseconds to delay.

Definition at line 44 of file RetryMiddleware.php.

Member Function Documentation

◆ __invoke()

GuzzleHttp\RetryMiddleware::__invoke ( RequestInterface  $request,
array  $options 
)
Parameters
RequestInterface$request
array$options
Returns
PromiseInterface

Definition at line 72 of file RetryMiddleware.php.

◆ exponentialDelay()

static GuzzleHttp\RetryMiddleware::exponentialDelay (   $retries)
static

Default exponential backoff delay function.

Parameters
int$retries
Returns
int milliseconds.

Definition at line 61 of file RetryMiddleware.php.


The documentation for this class was generated from the following file: