Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RetryMiddleware.php

function RetryMiddleware::__construct

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(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.:

(callable(int): int)|null $delay Function that accepts the number of retries: and returns the number of milliseconds to delay.

File

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

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal