You are here

private function RetryMiddleware::onRejected in Lockr 7.3

1 call to RetryMiddleware::onRejected()
RetryMiddleware::__invoke in vendor/guzzlehttp/guzzle/src/RetryMiddleware.php

File

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

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 \GuzzleHttp\Promise\rejection_for($reason);
    }
    return $this
      ->doRetry($req, $options);
  };
}