Open Journal Systems
3.3.0
|
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 | |
Abstract backoff strategy that allows for a chain of responsibility
Definition at line 12 of file AbstractBackoffStrategy.php.
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
int | $retries | Number of retries of the request |
RequestInterface | $request | Request that was sent |
Response | $response | Response that was received. Note that there may not be a response |
HttpException | $e | Exception that was encountered if any |
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().
|
abstractprotected |
Implement the concrete strategy
int | $retries | Number of retries of the request |
RequestInterface | $request | Request that was sent |
Response | $response | Response that was received. Note that there may not be a response |
HttpException | $e | Exception that was encountered if any |
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().
Guzzle\Plugin\Backoff\AbstractBackoffStrategy::getNext | ( | ) |
Get the next backoff strategy in the chain
Definition at line 31 of file AbstractBackoffStrategy.php.
References Guzzle\Plugin\Backoff\AbstractBackoffStrategy\$next.
|
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.
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.
Guzzle\Plugin\Backoff\AbstractBackoffStrategy::setNext | ( | AbstractBackoffStrategy | $next | ) |
AbstractBackoffStrategy | $next | Next strategy in the chain |
Definition at line 21 of file AbstractBackoffStrategy.php.
References Guzzle\Plugin\Backoff\AbstractBackoffStrategy\$next.
Referenced by Guzzle\Tests\Plugin\Backoff\AbstractBackoffStrategyTest\testReturnsZeroWhenDecisionMakerReturnsTrueButNoFurtherStrategiesAreInTheChain(), and Guzzle\Tests\Plugin\Backoff\AbstractBackoffStrategyTest\testSkipsOtherDecisionsInChainWhenOneReturnsTrue().
|
protected |
Next strategy in the chain
Definition at line 18 of file AbstractBackoffStrategy.php.
Referenced by Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy\__construct(), Guzzle\Plugin\Backoff\TruncatedBackoffStrategy\__construct(), Guzzle\Plugin\Backoff\CallbackBackoffStrategy\__construct(), Guzzle\Plugin\Backoff\AbstractBackoffStrategy\getBackoffPeriod(), Guzzle\Plugin\Backoff\AbstractBackoffStrategy\getNext(), and Guzzle\Plugin\Backoff\AbstractBackoffStrategy\setNext().