Skip to main content

Class: Backoff

Constructors

constructor

new Backoff(opts?)

Parameters

NameType
opts?Object
opts.factor?number
opts.jitter?number
opts.max?number
opts.minnumber

Properties

attempts

Private attempts: number = 0


factor

Private factor: number = 2


jitter

Private jitter: number = 0


max

Private max: number = 10_000


ms

Private ms: number = 100

Methods

duration

duration(): number

Returns

number


promise

promise(): Promise<unknown>

Returns

Promise<unknown>


reset

reset(): void

Returns

void