ResilienceContext
Defined in: src/core.ts:160
Properties
Section titled “Properties”attemptNumber
Section titled “attemptNumber”
readonlyattemptNumber: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.
attributes?
Section titled “attributes?”
readonlyoptionalattributes?:Readonly<Record<string,string|number|boolean>>
Defined in: src/core.ts:178
Extra low-cardinality telemetry attributes for this execution.
idempotent
Section titled “idempotent”
readonlyidempotent: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.
operationKey
Section titled “operationKey”
readonlyoperationKey:string|undefined
Defined in: src/core.ts:163
operationName?
Section titled “operationName?”
readonlyoptionaloperationName?:string
Defined in: src/core.ts:176
Operation name for telemetry (spans, metrics); defaults to the pipeline name.
properties
Section titled “properties”
readonlyproperties:Map<string,unknown>
Defined in: src/core.ts:165
Shared bag for passing data between strategies and the callback.
signal
Section titled “signal”
readonlysignal:AbortSignal
Defined in: src/core.ts:162
Aborted when the caller cancels, or when a strategy (timeout, hedging) gives up on this execution.
timeProvider?
Section titled “timeProvider?”
readonlyoptionaltimeProvider?: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.