Interface: BackoffOptions
client.BackoffOptions
Options for the backoff formula: factor ^ attempt * initialIntervalMs(status) * jitter(maxJitter)
Properties
factor
• factor: number
Exponential backoff factor
Default
1.7
maxAttempts
• maxAttempts: number
Maximum number of attempts
Default
10
maxJitter
• maxJitter: number
Maximum amount of jitter to apply
Default
0.2
Methods
initialIntervalMs
▸ initialIntervalMs(status
): number
Function that returns the "initial" backoff interval based on the returned status.
The default is 1 second for RESOURCE_EXHAUSTED errors and 100 millis for other retryable errors.
Parameters
Name | Type |
---|---|
status | StatusObject |
Returns
number
maxIntervalMs
▸ maxIntervalMs(status
): number
Function that returns the "maximum" backoff interval based on the returned status.
The default is 5 seconds regardless of the status.
Parameters
Name | Type |
---|---|
status | StatusObject |
Returns
number