\Guzzle\Plugin\BackoffTruncatedBackoffStrategy

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

Summary

Methods
Properties
Constants
setNext()
getNext()
getBackoffPeriod()
makesDecision()
__construct()
No public properties found
No constants found
getDelay()
$next
$max
N/A
No private methods found
No private properties found
N/A

Properties

$max

$max : integer

Type

integer — Maximum number of retries per request

Methods

getBackoffPeriod()

getBackoffPeriod(integer  $retries, \Guzzle\Http\Message\RequestInterface  $request, \Guzzle\Http\Message\Response  $response = null, \Guzzle\Http\Exception\HttpException  $e = null) : boolean|integer

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

Parameters

integer $retries

Number of retries of the request

\Guzzle\Http\Message\RequestInterface $request

Request that was sent

\Guzzle\Http\Message\Response $response

Response that was received. Note that there may not be a response

\Guzzle\Http\Exception\HttpException $e

Exception that was encountered if any

Returns

boolean|integer —

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

makesDecision()

makesDecision() : boolean

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

boolean

__construct()

__construct(integer  $maxRetries, \Guzzle\Plugin\Backoff\BackoffStrategyInterface  $next = null) 

Parameters

integer $maxRetries

Maximum number of retries per request

\Guzzle\Plugin\Backoff\BackoffStrategyInterface $next

The optional next strategy

getDelay()

getDelay(integer  $retries, \Guzzle\Http\Message\RequestInterface  $request, \Guzzle\Http\Message\Response  $response = null, \Guzzle\Http\Exception\HttpException  $e = null) : boolean|integer|null

Implement the concrete strategy

Parameters

integer $retries

Number of retries of the request

\Guzzle\Http\Message\RequestInterface $request

Request that was sent

\Guzzle\Http\Message\Response $response

Response that was received. Note that there may not be a response

\Guzzle\Http\Exception\HttpException $e

Exception that was encountered if any

Returns

boolean|integer|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.