Skip to content
1 min read · 140 words

Interface: CrashPolicy ​

Defined in: src/batteries/isolation/crash_policy.ts:35

A sliding-window crash-escalation decider, as returned by createCrashPolicy.

Properties ​

PropertyModifierTypeDescriptionDefined in
recentCountreadonlynumberNumber of crashes currently inside the window (observability/tests).src/batteries/isolation/crash_policy.ts:44

Methods ​

record() ​

ts
record(): CrashVerdict;

Defined in: src/batteries/isolation/crash_policy.ts:42

Record a crash event and return the escalation verdict: 'respawn' while the number of crashes inside the current window (including this one) is still under maxCrashes, 'giveUp' once it reaches maxCrashes. Prunes crashes older than the window before deciding, so a crash burst that cools off resets the count.

Returns ​

CrashVerdict


reset() ​

ts
reset(): void;

Defined in: src/batteries/isolation/crash_policy.ts:46

Clear the crash history (e.g. after a clean recovery + a settled session).

Returns ​

void