Google Cloud PHP shared dependency, providing functionality useful to all components. Client - Class ExponentialBackoff (1.49.3)

Reference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class ExponentialBackoff.

Exponential backoff implementation.

Methods

__construct

Parameters
NameDescription
retries int

[optional] Number of retries for a failed request.

retryFunction callable

[optional] returns bool for whether or not to retry

execute

Executes the retry process.

Parameters
NameDescription
function callable
arguments array

[optional]

Returns
TypeDescription
mixed

setDelayFunction

If not set, defaults to using usleep.

Parameter
NameDescription
delayFunction callable
Returns
TypeDescription
void

setCalcDelayFunction

If not set, defaults to using Google\Cloud\Core\ExponentialBackoff::calculateDelay().

Parameter
NameDescription
calcDelayFunction callable
Returns
TypeDescription
void

calculateDelay

Calculates exponential delay.

Parameter
NameDescription
attempt int

The attempt number used to calculate the delay.

Returns
TypeDescription
int

Constants

MAX_DELAY_MICROSECONDS

Value: 60000000