You are here

public static function RetryMiddleware::exponentialDelay in Zircon Profile 8

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

Default exponential backoff delay function.

Parameters

$retries:

Return value

int

File

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

Class

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

Namespace

GuzzleHttp

Code

public static function exponentialDelay($retries) {
  return (int) pow(2, $retries - 1);
}