You are here

private function RetryMiddleware::onRejected in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/RetryMiddleware.php \GuzzleHttp\RetryMiddleware::onRejected()
1 call to RetryMiddleware::onRejected()
RetryMiddleware::__invoke in vendor/guzzlehttp/guzzle/src/RetryMiddleware.php

File

vendor/guzzlehttp/guzzle/src/RetryMiddleware.php, line 89

Class

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

Namespace

GuzzleHttp

Code

private function onRejected(RequestInterface $req, array $options) {
  return function ($reason) use ($req, $options) {
    if (!call_user_func($this->decider, $options['retries'], $req, null, $reason)) {
      return new RejectedPromise($reason);
    }
    return $this
      ->doRetry($req, $options);
  };
}