Abstract Class Guzzle\Plugin\Backoff\AbstractBackoffStrategy

InheritanceGuzzle\Plugin\Backoff\AbstractBackoffStrategy
ImplementsGuzzle\Plugin\Backoff\BackoffStrategyInterface
SubclassesGuzzle\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

Abstract backoff strategy that allows for a chain of responsibility

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$next Guzzle\Plugin\Backoff\AbstractBackoffStrategy Next strategy in the chain Guzzle\Plugin\Backoff\AbstractBackoffStrategy

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getBackoffPeriod() Guzzle\Plugin\Backoff\AbstractBackoffStrategy
getNext() Get the next backoff strategy in the chain Guzzle\Plugin\Backoff\AbstractBackoffStrategy
makesDecision() Check if the strategy does filtering and makes decisions on whether or not to retry. Guzzle\Plugin\Backoff\AbstractBackoffStrategy
setNext() Guzzle\Plugin\Backoff\AbstractBackoffStrategy

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getDelay() Implement the concrete strategy Guzzle\Plugin\Backoff\AbstractBackoffStrategy

Property Details

$next protected property

Next strategy in the chain

Method Details

getBackoffPeriod() public method

public void getBackoffPeriod ( $retries, Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response null, Guzzle\Http\Exception\HttpException $e null )
$retries
$request
$response
$e
getDelay() protected abstract method

Implement the concrete strategy

protected abstract bool|int|null getDelay ( $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|null

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

                  or null to defer to the next strategy if available, and if not, return 0.
getNext() public method

Get the next backoff strategy in the chain

public Guzzle\Plugin\Backoff\AbstractBackoffStrategy|null getNext ( )
makesDecision() public abstract method

Check if the strategy does filtering and makes decisions on whether or not to retry.

Strategies that return false will never retry if all of the previous strategies in a chain defer on a backoff decision.

public abstract bool makesDecision ( )
setNext() public method

public void setNext ( Guzzle\Plugin\Backoff\AbstractBackoffStrategy $next )
$next Guzzle\Plugin\Backoff\AbstractBackoffStrategy

Next strategy in the chain