You are here

private function RetryMiddleware::onFulfilled in Lockr 7.3

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

File

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

Class

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

Namespace

GuzzleHttp

Code

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