Skip to main content

Interface: RetryOptions

Defined in: async/types.ts:4

Options for retry operations.

Properties

backoff?

readonly optional backoff: number

Defined in: async/types.ts:22

Backoff multiplier for exponential backoff. Set to 1 for constant delay.

Default

2

delay?

readonly optional delay: number

Defined in: async/types.ts:15

Initial delay in milliseconds before the first retry.

Default

1000

maxAttempts?

readonly optional maxAttempts: number

Defined in: async/types.ts:9

Maximum number of retry attempts.

Default

3

maxDelay?

readonly optional maxDelay: number

Defined in: async/types.ts:28

Maximum delay in milliseconds between retries.

Default

30000

onRetry()?

readonly optional onRetry: (error, attempt, delay) => void

Defined in: async/types.ts:39

Callback invoked on each retry attempt.

Parameters

error

unknown

attempt

number

delay

number

Returns

void


shouldRetry()?

readonly optional shouldRetry: (error, attempt) => boolean

Defined in: async/types.ts:34

Function to determine if an error should be retried. Return true to retry, false to fail immediately.

Parameters

error

unknown

attempt

number

Returns

boolean