function RetryMiddleware::onRejected
Execute rejected closure
1 call to RetryMiddleware::onRejected()
- RetryMiddleware::__invoke in vendor/
guzzlehttp/ guzzle/ src/ RetryMiddleware.php
File
-
vendor/
guzzlehttp/ guzzle/ src/ RetryMiddleware.php, line 97
Class
- RetryMiddleware
- Middleware that retries requests based on the boolean result of invoking the provided "decider" function.
Namespace
GuzzleHttpCode
private function onRejected(RequestInterface $req, array $options) : callable {
return function ($reason) use ($req, $options) {
if (!($this->decider)($options['retries'], $req, null, $reason)) {
return P\Create::rejectionFor($reason);
}
return $this->doRetry($req, $options);
};
}