Readonly
backoff: boolean | numberWhether poll frequency backs off (boolean) or the backoff growth rate (float > 1).
If true
, the default backoff growth rate is 3
.
Readonly
interval: numberThe basic polling interval in milliseconds (integer).
Readonly
max: numberThe maximum milliseconds (integer) between poll requests.
The polling frequency parameters.
Notes
We implement the "decorrelated jitter" strategy from https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/. Essentially, if consecutive retries are needed, we choose an integer:
sleep = min(max, rand(interval, backoff * sleep))
This ensures that the poll is never less thaninterval
, and nicely spreads out retries for consecutive tries. Over time, if (interval < max), the random number will be abovemax
about (1 - 1/backoff) of the time (sleeping themax
), and the rest of the time the sleep will be a random number belowmax
, decorrelating our trigger time from other pollers.