Skip to content

HedgingOptions

Defined in: src/hedging.ts:44

T

optional actionGenerator?: (args) => ((context) => MaybePromise<T>) | undefined

Defined in: src/hedging.ts:57

Return a different action for hedged attempts (e.g. another endpoint), or undefined to repeat the original.

HedgingActionArgs<T>

((context) => MaybePromise<T>) | undefined


optional delay?: Duration

Defined in: src/hedging.ts:53

ms to wait before starting another attempt. Default 2000. > 0 latency mode, 0 parallel mode (all at once), < 0 fallback mode (next attempt only after a failure).


optional delayGenerator?: (args) => MaybePromise<Duration | undefined>

Defined in: src/hedging.ts:55

Delay before the attempt about to start; undefined uses delay.

HedgingDelayArgs

MaybePromise<Duration | undefined>


optional maxHedgedAttempts?: number

Defined in: src/hedging.ts:48

Hedged attempts in addition to the primary. Default 1.


optional name?: string

Defined in: src/hedging.ts:45


optional onHedging?: (args) => MaybePromise<void>

Defined in: src/hedging.ts:58

OnHedgingArgs

MaybePromise<void>


optional shouldHandle?: ShouldHandle<OutcomeArgs<T>>

Defined in: src/hedging.ts:46