File: AsyncRetryerOptions.md | Updated: 11/15/2025
Search...
+ K
Auto
Docs Examples GitHub Contributors
Docs Examples GitHub Contributors
Docs Examples GitHub Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide
Documentation
Framework
React
Version
Latest
Search...
+ K
Menu
Getting Started
Guides
API Reference
Debouncer API Reference
Throttler API Reference
Rate Limiter API Reference
Queue API Reference
Batcher API Reference
Debouncer Examples
Throttler Examples
Rate Limiter Examples
Queue Examples
Batcher Examples
TanStack Query Examples
Framework
React
Version
Latest
Menu
Getting Started
Guides
API Reference
Debouncer API Reference
Throttler API Reference
Rate Limiter API Reference
Queue API Reference
Batcher API Reference
Debouncer Examples
Throttler Examples
Rate Limiter Examples
Queue Examples
Batcher Examples
TanStack Query Examples
On this page
Copy Markdown
Interface: AsyncRetryerOptions<TFn>
===================================
Defined in: async-retryer.ts:60
Type Parameters
---------------
### TFn
TFn extends AnyAsyncFunction
Properties
----------
### backoff?
ts
optional backoff: "linear" | "exponential" | "fixed";
optional backoff: "linear" | "exponential" | "fixed";
Defined in: async-retryer.ts:68
The backoff strategy for retry delays:
ts
'exponential'
'exponential'
ts
optional baseWait: number | (retryer) => number;
optional baseWait: number | (retryer) => number;
Defined in: async-retryer.ts:73
Base wait time in milliseconds between retries, or a function that returns the wait time
ts
1000
1000
ts
optional enabled: boolean | (retryer) => boolean;
optional enabled: boolean | (retryer) => boolean;
Defined in: async-retryer.ts:78
Whether the retryer is enabled, or a function that determines if it's enabled
ts
true
true
ts
optional initialState: Partial<AsyncRetryerState<TFn>>;
optional initialState: Partial<AsyncRetryerState<TFn>>;
Defined in: async-retryer.ts:82
Initial state to merge with the default state
ts
optional jitter: number;
optional jitter: number;
Defined in: async-retryer.ts:87
Jitter percentage to add to retry delays (0-1). Adds randomness to prevent thundering herd.
ts
0
0
ts
optional key: string;
optional key: string;
Defined in: async-retryer.ts:92
Optional key to identify this async retryer instance. If provided, the async retryer will be identified by this key in the devtools and PacerProvider if applicable.
ts
optional maxAttempts: number | (retryer) => number;
optional maxAttempts: number | (retryer) => number;
Defined in: async-retryer.ts:97
Maximum number of retry attempts, or a function that returns the max attempts
ts
3
3
ts
optional maxExecutionTime: number;
optional maxExecutionTime: number;
Defined in: async-retryer.ts:102
Maximum execution time in milliseconds for a single function call before aborting
ts
Infinity
Infinity
ts
optional maxTotalExecutionTime: number;
optional maxTotalExecutionTime: number;
Defined in: async-retryer.ts:107
Maximum total execution time in milliseconds for the entire retry operation before aborting
ts
Infinity
Infinity
ts
optional onAbort: (reason, retryer) => void;
optional onAbort: (reason, retryer) => void;
Defined in: async-retryer.ts:111
Callback invoked when the execution is aborted (manually or due to timeouts)
"manual" | "execution-timeout" | "total-timeout" | "new-execution"
AsyncRetryer <TFn>
void
ts
optional onError: (error, args, retryer) => void;
optional onError: (error, args, retryer) => void;
Defined in: async-retryer.ts:118
Callback invoked when any error occurs during execution (including retries)
Error
Parameters<TFn>
AsyncRetryer <TFn>
void
ts
optional onExecutionTimeout: (retryer) => void;
optional onExecutionTimeout: (retryer) => void;
Defined in: async-retryer.ts:146
Callback invoked when a single execution attempt times out (maxExecutionTime exceeded)
AsyncRetryer <TFn>
void
ts
optional onLastError: (error, retryer) => void;
optional onLastError: (error, retryer) => void;
Defined in: async-retryer.ts:126
Callback invoked when the final error occurs after all retries are exhausted
Error
AsyncRetryer <TFn>
void
ts
optional onRetry: (attempt, error, retryer) => void;
optional onRetry: (attempt, error, retryer) => void;
Defined in: async-retryer.ts:130
Callback invoked before each retry attempt
number
Error
AsyncRetryer <TFn>
void
ts
optional onSettled: (args, retryer) => void;
optional onSettled: (args, retryer) => void;
Defined in: async-retryer.ts:134
Callback invoked after execution completes (success or failure) of each attempt
Parameters<TFn>
AsyncRetryer <TFn>
void
ts
optional onSuccess: (result, args, retryer) => void;
optional onSuccess: (result, args, retryer) => void;
Defined in: async-retryer.ts:138
Callback invoked when execution succeeds
Awaited<ReturnType<TFn>>
Parameters<TFn>
AsyncRetryer <TFn>
void
### onTotalExecutionTimeout()?
ts
optional onTotalExecutionTimeout: (retryer) => void;
optional onTotalExecutionTimeout: (retryer) => void;
Defined in: async-retryer.ts:150
Callback invoked when the total execution time times out (maxTotalExecutionTime exceeded)
AsyncRetryer <TFn>
void
ts
optional throwOnError: boolean | "last";
optional throwOnError: boolean | "last";
Defined in: async-retryer.ts:158
Controls when errors are thrown:
ts
'last'
'last'
