Open Journal Systems  3.3.0
Guzzle\Plugin\Backoff\AbstractBackoffStrategy Class Reference
Inheritance diagram for Guzzle\Plugin\Backoff\AbstractBackoffStrategy:
Guzzle\Plugin\Backoff\BackoffStrategyInterface Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy Guzzle\Plugin\Backoff\CallbackBackoffStrategy Guzzle\Plugin\Backoff\ConstantBackoffStrategy Guzzle\Plugin\Backoff\ExponentialBackoffStrategy Guzzle\Plugin\Backoff\LinearBackoffStrategy Guzzle\Plugin\Backoff\TruncatedBackoffStrategy Guzzle\Plugin\Backoff\CurlBackoffStrategy Guzzle\Plugin\Backoff\HttpBackoffStrategy Guzzle\Plugin\Backoff\ReasonPhraseBackoffStrategy

Public Member Functions

 getBackoffPeriod ( $retries, RequestInterface $request, Response $response=null, HttpException $e=null)
 
 getNext ()
 
 makesDecision ()
 
 setNext (AbstractBackoffStrategy $next)
 

Protected Member Functions

 getDelay ( $retries, RequestInterface $request, Response $response=null, HttpException $e=null)
 

Protected Attributes

 $next
 

Detailed Description

Abstract backoff strategy that allows for a chain of responsibility

Definition at line 12 of file AbstractBackoffStrategy.php.

Member Function Documentation

◆ getBackoffPeriod()

Guzzle\Plugin\Backoff\AbstractBackoffStrategy::getBackoffPeriod (   $retries,
RequestInterface  $request,
Response  $response = null,
HttpException  $e = null 
)

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

Parameters
int$retriesNumber of retries of the request
RequestInterface$requestRequest that was sent
Response$responseResponse that was received. Note that there may not be a response
HttpException$eException that was encountered if any
Returns
bool|int Returns false to not retry or the number of seconds to delay between retries

Implements Guzzle\Plugin\Backoff\BackoffStrategyInterface.

Definition at line 36 of file AbstractBackoffStrategy.php.

References Guzzle\Plugin\Backoff\AbstractBackoffStrategy\$next, and Guzzle\Plugin\Backoff\AbstractBackoffStrategy\getDelay().

◆ getDelay()

Guzzle\Plugin\Backoff\AbstractBackoffStrategy::getDelay (   $retries,
RequestInterface  $request,
Response  $response = null,
HttpException  $e = null 
)
abstractprotected

Implement the concrete strategy

Parameters
int$retriesNumber of retries of the request
RequestInterface$requestRequest that was sent
Response$responseResponse that was received. Note that there may not be a response
HttpException$eException that was encountered if any
Returns
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.

Reimplemented in Guzzle\Plugin\Backoff\CallbackBackoffStrategy, Guzzle\Plugin\Backoff\LinearBackoffStrategy, Guzzle\Plugin\Backoff\TruncatedBackoffStrategy, Guzzle\Plugin\Backoff\ConstantBackoffStrategy, Guzzle\Plugin\Backoff\CurlBackoffStrategy, Guzzle\Plugin\Backoff\ExponentialBackoffStrategy, Guzzle\Plugin\Backoff\HttpBackoffStrategy, and Guzzle\Plugin\Backoff\ReasonPhraseBackoffStrategy.

Referenced by Guzzle\Plugin\Backoff\AbstractBackoffStrategy\getBackoffPeriod().

◆ getNext()

Guzzle\Plugin\Backoff\AbstractBackoffStrategy::getNext ( )

Get the next backoff strategy in the chain

Returns
AbstractBackoffStrategy|null

Definition at line 31 of file AbstractBackoffStrategy.php.

References Guzzle\Plugin\Backoff\AbstractBackoffStrategy\$next.

◆ makesDecision()

Guzzle\Plugin\Backoff\AbstractBackoffStrategy::makesDecision ( )
abstract

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.

Returns
bool

Reimplemented in Guzzle\Plugin\Backoff\CallbackBackoffStrategy, Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy, Guzzle\Plugin\Backoff\LinearBackoffStrategy, Guzzle\Plugin\Backoff\TruncatedBackoffStrategy, Guzzle\Plugin\Backoff\ConstantBackoffStrategy, Guzzle\Plugin\Backoff\ExponentialBackoffStrategy, and Guzzle\Plugin\Backoff\ReasonPhraseBackoffStrategy.

◆ setNext()

Field Documentation

◆ $next


The documentation for this class was generated from the following file: