You are here

private function RetryMiddleware::onFulfilled in Zircon Profile 8

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

File

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

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);
  };
}