Open Journal Systems  3.3.0
Guzzle\Plugin\Backoff\HttpBackoffStrategy Class Reference
Inheritance diagram for Guzzle\Plugin\Backoff\HttpBackoffStrategy:
Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy Guzzle\Plugin\Backoff\AbstractBackoffStrategy Guzzle\Plugin\Backoff\BackoffStrategyInterface

Protected Member Functions

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

Static Protected Attributes

static $defaultErrorCodes = array(500, 503)
 
- Static Protected Attributes inherited from Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy
static $defaultErrorCodes = array()
 

Additional Inherited Members

- Public Member Functions inherited from Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy
 __construct (array $codes=null, BackoffStrategyInterface $next=null)
 
 makesDecision ()
 
- Public Member Functions inherited from Guzzle\Plugin\Backoff\AbstractBackoffStrategy
 getBackoffPeriod ( $retries, RequestInterface $request, Response $response=null, HttpException $e=null)
 
 getNext ()
 
 setNext (AbstractBackoffStrategy $next)
 
- Static Public Member Functions inherited from Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy
static getDefaultFailureCodes ()
 
- Protected Attributes inherited from Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy
 $errorCodes
 
- Protected Attributes inherited from Guzzle\Plugin\Backoff\AbstractBackoffStrategy
 $next
 

Detailed Description

Strategy used to retry HTTP requests based on the response code.

Retries 500 and 503 error by default.

Definition at line 14 of file HttpBackoffStrategy.php.

Member Function Documentation

◆ getDelay()

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

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 from Guzzle\Plugin\Backoff\AbstractBackoffStrategy.

Definition at line 19 of file HttpBackoffStrategy.php.

Field Documentation

◆ $defaultErrorCodes

Guzzle\Plugin\Backoff\HttpBackoffStrategy::$defaultErrorCodes = array(500, 503)
staticprotected

Definition at line 17 of file HttpBackoffStrategy.php.


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