Appearance
Function: backoffFor()
ts
function backoffFor(
attempt,
timings,
random?
): number;The backoff step for attempt n (1-based), jittered.
The last step repeats rather than growing without bound: a client that has been away twenty minutes has nothing left to resume to, and one that comes back after an hour should still be trying every eight seconds rather than every four minutes.
Parameters
| Parameter | Type | Default value |
|---|---|---|
attempt | number | undefined |
timings | Timings | undefined |
random | () => number | Math.random |
Returns
number