RetryOptions
import { RetryOptions } from "jsr:@ende/async";interface
interface RetryOptionsOptions for retry.
Properties
multiplier
multiplier?: numberHow much to backoff after each retry.
Default: 2
maxTimeout
maxTimeout?: numberThe maximum milliseconds between attempts.
Default: 60000
maxAttempts
maxAttempts?: numberThe maximum amount of attempts until failure.
Default: 5
minTimeout
minTimeout?: numberThe initial and minimum amount of milliseconds between attempts.
Default: 1000
jitter
jitter?: numberAmount of jitter to introduce to the time between attempts. This is 1
for full jitter by default.
Default: 1
isRetriable
isRetriable?: (err: unknown) => booleanCallback to determine if an error or other thrown value is retriable.
Default: () => true
Returns
true if the error is retriable, false otherwise.
signal
signal?: AbortSignalAn AbortSignal to cancel the retry operation.
If the signal is aborted, the retry will stop and reject with the signal's reason. The signal is checked before each attempt and during the delay between attempts.
Default: undefined