function RetryMiddleware::__construct
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(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.:
(callable(int): int)|null $delay Function that accepts the number of retries: and returns the number of milliseconds to delay.
File
-
vendor/
guzzlehttp/ guzzle/ src/ RetryMiddleware.php, line 43
Class
- RetryMiddleware
- Middleware that retries requests based on the boolean result of invoking the provided "decider" function.
Namespace
GuzzleHttpCode
public function __construct(callable $decider, callable $nextHandler, ?callable $delay = null) {
$this->decider = $decider;
$this->nextHandler = $nextHandler;
$this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
}