Type alias Frequency

Frequency: {
    backoff: boolean | number;
    interval: number;
    max: number;
}

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 than interval, and nicely spreads out retries for consecutive tries. Over time, if (interval < max), the random number will be above max about (1 - 1/backoff) of the time (sleeping the max), and the rest of the time the sleep will be a random number below max, decorrelating our trigger time from other pollers.

Type declaration

  • Readonly backoff: boolean | number

    Whether poll frequency backs off (boolean) or the backoff growth rate (float > 1).

    Notes

    If true, the default backoff growth rate is 3.

  • Readonly interval: number

    The basic polling interval in milliseconds (integer).

  • Readonly max: number

    The maximum milliseconds (integer) between poll requests.