Middleware that retries requests based on the boolean result of invoking the provided "decider" function.
Definition at line 14 of file RetryMiddleware.php.
◆ __construct()
GuzzleHttp\RetryMiddleware::__construct |
( |
callable |
$decider, |
|
|
callable |
$nextHandler, |
|
|
callable |
$delay = null |
|
) |
| |
- Parameters
-
callable | $decider | Function that accepts the number of retries, a request, [response], and [exception] and returns true if the request is to be retried. |
callable | $nextHandler | Next handler to invoke. |
callable | $delay | Function that accepts the number of retries and [response] and returns the number of milliseconds to delay. |
Definition at line 44 of file RetryMiddleware.php.
◆ __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
-
- Returns
- int milliseconds.
Definition at line 61 of file RetryMiddleware.php.
The documentation for this class was generated from the following file: