amqpx / index / retryStrategies / exponentialBackoff
Function: exponentialBackoff()
exponentialBackoff(
multiplier,base?,jitter?): (step) =>number
Defined in: src/retry/time-strategies.ts:50
Increases the delay each step using the formula multiplier * base^(step-1). For base=2 and multiplier=100 results in the series: 100, 200, 400, 800, ...
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
multiplier | number | undefined | Multiplier of the function, specifying the delay at the first step. Default is 100. |
base | number | 2 | Base of the exponential function. Default is 2, resulting in doubling the time each step. |
jitter | number | 0.25 | Jitter factor in [0, 1]. Randomizes the delay within ±jitter * delay. Use 0 to disable jitter. |
Returns
(step) => number