Interface Guzzle\Plugin\Backoff\BackoffStrategyInterface

Implemented byGuzzle\Plugin\Backoff\AbstractBackoffStrategy, Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy, Guzzle\Plugin\Backoff\CallbackBackoffStrategy, Guzzle\Plugin\Backoff\ConstantBackoffStrategy, Guzzle\Plugin\Backoff\CurlBackoffStrategy, Guzzle\Plugin\Backoff\ExponentialBackoffStrategy, Guzzle\Plugin\Backoff\HttpBackoffStrategy, Guzzle\Plugin\Backoff\LinearBackoffStrategy, Guzzle\Plugin\Backoff\ReasonPhraseBackoffStrategy, Guzzle\Plugin\Backoff\TruncatedBackoffStrategy

Strategy to determine if a request should be retried and how long to delay between retries

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getBackoffPeriod() Get the amount of time to delay in seconds before retrying a request Guzzle\Plugin\Backoff\BackoffStrategyInterface

Method Details

getBackoffPeriod() public abstract method

Get the amount of time to delay in seconds before retrying a request

public abstract bool|int getBackoffPeriod ( $retries, Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response null, Guzzle\Http\Exception\HttpException $e null )
$retries int

Number of retries of the request

$request Guzzle\Http\Message\RequestInterface

Request that was sent

$response Guzzle\Http\Message\Response

Response that was received. Note that there may not be a response

$e Guzzle\Http\Exception\HttpException

Exception that was encountered if any

return bool|int

Returns false to not retry or the number of seconds to delay between retries