Copied!

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

  • final
CloneableInstantiable
Methods
public __construct(callable $decider, callable $nextHandler, ?callable $delay = NULL)
 
  • param callable $decider Function that accepts the number of retries,
    a request, [response], and [exception] and
    returns true if the request is to be
    retried.
public __invoke(Psr\Http\Message\RequestInterface $request, array $options) : GuzzleHttp\Promise\PromiseInterface
public static exponentialDelay(int $retries) : int
 

Default exponential backoff delay function.

  • return int milliseconds.
Properties
private $decider
 
  • var callable
private $delay
 
  • var callable|(int)
private $nextHandler
 
    Methods
    private doRetry(Psr\Http\Message\RequestInterface $request, array $options, ?Psr\Http\Message\ResponseInterface $response = NULL) : GuzzleHttp\Promise\PromiseInterface
    private onFulfilled(Psr\Http\Message\RequestInterface $request, array $options) : callable
     

    Execute fulfilled closure

    private onRejected(Psr\Http\Message\RequestInterface $req, array $options) : callable
     

    Execute rejected closure

    Methods
    public static exponentialDelay(int $retries) : int
     

    Default exponential backoff delay function.

    • return int milliseconds.
    © 2022 Bruce Wells
    Search Namespaces \ Classes
    Configuration