class BackoffSettings

Holds the parameters used for exponential backoff logic.

The "total timeout" parameter has ultimate control over how long the logic should keep trying the remote call until it gives up completely. The higher the total timeout, the more retries can be attempted. The other settings are considered more advanced.

Retry delay and timeout start at specific values, and are tracked separately from each other. The very first call (before any retries) will use the initial timeout.

If the last remote call is a failure, then the retrier will wait for the current retry delay before attempting another call, and then the retry delay will be multiplied by the retry delay multiplier for the next failure. The timeout will not be affected, except in the case where the timeout would result in a deadline past the total timeout; in that circumstance, a new timeout value is computed which will terminate the call when the total time is up.

If the last remote call is a timeout, then the retrier will compute a new timeout and make another call. The new timeout is computed by multiplying the current timeout by the timeout multiplier, but if that results in a deadline after the total timeout, then a new timeout value is computed which will terminate the call when the total time is up.

Methods

static 
fromSnakeCase(array $settings)

Constructs an instance from snake-case parameters.

__construct(array $settings)

Constructs an instance.

getInitialRetryDelayMillis()

No description

getRetryDelayMultiplier()

No description

getMaxRetryDelayMillis()

No description

getInitialRpcTimeoutMillis()

No description

getRpcTimeoutMultiplier()

No description

getMaxRpcTimeoutMillis()

No description

getTotalTimeoutMillis()

No description

Details

at line 85
static fromSnakeCase(array $settings)

Constructs an instance from snake-case parameters.

Parameters

array $settings { Required. Settings for configuring the backoff settings

@type integer $initial_retry_delay_millis The initial delay of retry in milliseconds.
@type integer $retry_delay_multiplier The exponential multiplier of retry delay.
@type integer $max_retry_delay_millis The max delay of retry in milliseconds.
@type integer $initial_rpc_timeout_millis The initial timeout of rpc call in milliseconds.
@type integer $rpc_timeout_multiplier The exponential multiplier of rpc timeout.
@type integer $max_rpc_timeout_millis The max timout of rpc call in milliseconds.
@type integer $total_timeout_millis The max accumulative timeout in total.

}

at line 111
__construct(array $settings)

Constructs an instance.

Parameters

array $settings { Required. Settings for configuring the backoff settings

@type integer $initialRetryDelayMillis The initial delay of retry in milliseconds.
@type integer $retryDelayMultiplier The exponential multiplier of retry delay.
@type integer $maxRetryDelayMillis The max delay of retry in milliseconds.
@type integer $initialRpcTimeoutMillis The initial timeout of rpc call in milliseconds.
@type integer $rpcTimeoutMultiplier The exponential multiplier of rpc timeout.
@type integer $maxRpcTimeoutMillis The max timout of rpc call in milliseconds.
@type integer $totalTimeoutMillis The max accumulative timeout in total.

}

at line 123
getInitialRetryDelayMillis()

at line 128
getRetryDelayMultiplier()

at line 133
getMaxRetryDelayMillis()

at line 138
getInitialRpcTimeoutMillis()

at line 143
getRpcTimeoutMultiplier()

at line 148
getMaxRpcTimeoutMillis()

at line 153
getTotalTimeoutMillis()