Works with
•JSR Score70%•It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun




Published2 years ago (0.215.0)
Classes
c
RetryError()
cause: unknown,
attempts: number
Error thrown in retry once the maximum number of failed attempts
has been reached.
Functions
f
retry<T>(): Promise<T>
fn: (() => Promise<T>) | (() => T),
opts?: RetryOptions
Calls the given (possibly asynchronous) function up to maxAttempts times.
Retries as long as the given function throws. If the attempts are exhausted,
throws a RetryError with cause set to the inner exception.
Interfaces
I
Options for retry.
- jitter: number
Amount of jitter to introduce to the time between attempts. This is
1for full jitter by default. - maxAttempts: number
The maximum amount of attempts until failure.
- maxTimeout: number
The maximum milliseconds between attempts.
- minTimeout: number
The initial and minimum amount of milliseconds between attempts.
- multiplier: number
How much to backoff after each retry.