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

Public Member Functions

 __construct ($maxRetries, 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)
 

Protected Member Functions

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

Protected Attributes

 $max
 
- Protected Attributes inherited from Guzzle\Plugin\Backoff\AbstractBackoffStrategy
 $next
 

Detailed Description

Strategy that will not retry more than a certain number of times.

Definition at line 12 of file TruncatedBackoffStrategy.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Plugin\Backoff\TruncatedBackoffStrategy::__construct (   $maxRetries,
BackoffStrategyInterface  $next = null 
)
Parameters
int$maxRetriesMaximum number of retries per request
BackoffStrategyInterface$nextThe optional next strategy

Definition at line 24 of file TruncatedBackoffStrategy.php.

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

Member Function Documentation

◆ getDelay()

Guzzle\Plugin\Backoff\TruncatedBackoffStrategy::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 35 of file TruncatedBackoffStrategy.php.

◆ makesDecision()

Guzzle\Plugin\Backoff\TruncatedBackoffStrategy::makesDecision ( )

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

Definition at line 30 of file TruncatedBackoffStrategy.php.

Field Documentation

◆ $max

int Guzzle\Plugin\Backoff\TruncatedBackoffStrategy::$max
protected

Maximum number of retries per request

Definition at line 18 of file TruncatedBackoffStrategy.php.


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