You are here

public function RetryMiddleware::__construct in Lockr 7.3

Parameters

callable $decider Function that accepts the number of retries,: a request, [response], and [exception] and returns true if the request is to be retried.

callable $nextHandler Next handler to invoke.:

callable $delay Function that accepts the number of retries: and [response] and returns the number of milliseconds to delay.

File

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

Class

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

Namespace

GuzzleHttp

Code

public function __construct(callable $decider, callable $nextHandler, callable $delay = null) {
  $this->decider = $decider;
  $this->nextHandler = $nextHandler;
  $this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
}