Skip to content

ResilienceContext

Defined in: src/core.ts:160

readonly attemptNumber: number

Defined in: src/core.ts:172

0 for the first attempt, then 1, 2, … in the order attempts start. Use it for logging or per-attempt idempotency keys. One counter per execution numbers every retry and hedged attempt, however retry and hedging are nested (retry around hedging, retry inside hedged branches), so a number is never repeated within an execution. Strategies’ own counters (RetryPredicateArgs.attemptNumber, OnHedgingArgs.attemptNumber) stay local.


readonly optional attributes?: Readonly<Record<string, string | number | boolean>>

Defined in: src/core.ts:178

Extra low-cardinality telemetry attributes for this execution.


readonly idempotent: boolean

Defined in: src/core.ts:174

false when the call must not run twice (e.g. a payment): retry and hedging then only repeat calls that never started.


readonly operationKey: string | undefined

Defined in: src/core.ts:163


readonly optional operationName?: string

Defined in: src/core.ts:176

Operation name for telemetry (spans, metrics); defaults to the pipeline name.


readonly properties: Map<string, unknown>

Defined in: src/core.ts:165

Shared bag for passing data between strategies and the callback.


readonly signal: AbortSignal

Defined in: src/core.ts:162

Aborted when the caller cancels, or when a strategy (timeout, hedging) gives up on this execution.


readonly optional timeProvider?: TimeProvider

Defined in: src/core.ts:183

Clock for this execution’s own timing (retry delays, timeouts, hedging delays, chaos latency). Stateful strategies (breakers, limiters, caches, locks) keep the pipeline’s clock, since their state spans executions.