Skip to content

RetryOptions

Defined in: src/pattern/retry.ts:1

readonly attempts: number

Defined in: src/pattern/retry.ts:3

Total attempts including the initial call. Must be >= 1.


readonly optional delayMs?: number

Defined in: src/pattern/retry.ts:5

Base delay between retries, in ms.


readonly optional factor?: number

Defined in: src/pattern/retry.ts:7

Exponential-backoff multiplier applied to delayMs (default 1 — no backoff).


readonly optional maxDelayMs?: number

Defined in: src/pattern/retry.ts:9

Upper bound for any individual retry delay.


readonly optional onAttempt?: (err, attempt) => void

Defined in: src/pattern/retry.ts:16

Called after each failed attempt; useful for logging/metrics.

Error

number

void


readonly optional shouldRetry?: (err, attempt) => boolean

Defined in: src/pattern/retry.ts:14

Predicate that decides whether a specific error is retryable. Return false to short-circuit with the final error. Defaults to “retry any”.

Error

number

boolean