public function RetryMiddleware::__invoke in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/guzzle/src/RetryMiddleware.php \GuzzleHttp\RetryMiddleware::__invoke()
Parameters
RequestInterface $request:
array $options:
Return value
File
- vendor/
guzzlehttp/ guzzle/ src/ RetryMiddleware.php, line 59
Class
- RetryMiddleware
- Middleware that retries requests based on the boolean result of invoking the provided "decider" function.
Namespace
GuzzleHttpCode
public function __invoke(RequestInterface $request, array $options) {
if (!isset($options['retries'])) {
$options['retries'] = 0;
}
$fn = $this->nextHandler;
return $fn($request, $options)
->then($this
->onFulfilled($request, $options), $this
->onRejected($request, $options));
}