Skip to content

amqpx v1.0.1


amqpx / index / retryStrategies / polynomialBackoff

Function: polynomialBackoff()

polynomialBackoff(multiplier, exponent?, jitter?): (step) => number

Defined in: src/retry/time-strategies.ts:78

Increases the delay each step using the formula multiplier * step^exponent. For exponent=2 (quadratic) and multiplier=100 results in the series: 100, 400, 900, 1600, ...

Parameters

ParameterTypeDefault valueDescription
multipliernumberundefinedMultiplier of the function, specifying the delay at the first step.
exponentnumber2Exponent of the polynomial. Default is 2 (quadratic).
jitternumber0.25Jitter factor in [0, 1]. Randomizes the delay within ±jitter * delay. Use 0 to disable jitter.

Returns

(step) => number

Released under the MIT License.