Skip to content

backoff

const backoff: object

Defined in: src/backoff.ts:27

Delay schedules as plain functions of the attempt number (0-based), for delayGenerator, waitFor({ interval }), or your own loops: addRetry({ delayGenerator: backoff.exponential({ delay: '100ms', maxDelay: '10s', useJitter: 'full' }) }).

constant: (options) => (attempt) => number

BackoffOptions

(attempt) => number

exponential: (options) => (attempt) => number

BackoffOptions & object

(attempt) => number

linear: (options) => (attempt) => number

BackoffOptions

(attempt) => number

sequence: (delays) => (attempt) => number

A fixed list of delays (cockatiel’s IterableBackoff); the last one repeats: backoff.sequence(['100ms', '1s', '5s']).

readonly Duration[]

(attempt) => number