FallbackOptions
Defined in: core/src/fallback.ts:29
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Properties
Section titled “Properties”cooldownMs?
Section titled “cooldownMs?”optional cooldownMs?: Partial<Record<ErrorKind, number | null>>;Defined in: core/src/fallback.ts:32
Per-kind intervals in ms; null stops fallback for that kind. Adding a kind opts it into fallback. Cancellation is never overridable.
cooldowns?
Section titled “cooldowns?”optional cooldowns?: CooldownStore<T>;Defined in: core/src/fallback.ts:47
Where cooldowns live; a private Map when omitted. Hand one store to every
pool that holds the same candidate and a lockout learned in one chain
benches it in all of them, instead of each chain spending a call to find
the same weekly wall. Pools sharing a store must share cooldownMs too: a
bench set by one pool is honoured by the others, so a kind one of them
turned off (null) would still divert its calls whenever another pool
benched the candidate for it.
optional now?: () => number;Defined in: core/src/fallback.ts:55
Inject a clock for deterministic tests.
Returns
Section titled “Returns”number
onCooldown?
Section titled “onCooldown?”optional onCooldown?: (info) => void;Defined in: core/src/fallback.ts:33
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
info |
{ candidate: T; error: unknown; kind: ErrorKind; retryAtMs: number; window?: RateLimitWindow; } |
info.candidate |
T |
info.error |
unknown |
info.kind |
ErrorKind |
info.retryAtMs |
number |
info.window? |
RateLimitWindow |
Returns
Section titled “Returns”void
probeStaleMs?
Section titled “probeStaleMs?”optional probeStaleMs?: number;Defined in: core/src/fallback.ts:53
How long a recovery probe may go without a first chunk before another
call may replace it. A probe that hung used to hold its candidate out of
service for good. Defaults to the watchdog’s progress clock
(STREAM_PROGRESS_MS): a call silent that long is one the watchdog
would already have killed.