footprintjs - v11.2.0
    Preparing search index...

    Interface FlowRecorder

    FlowRecorder — Pluggable observer for control flow events.

    Mirrors the scope-level ScopeRecorder pattern for the engine layer. All methods are optional — implement only the hooks you need. Recorders are invoked synchronously in attachment order. If a recorder throws, the error is caught and swallowed; execution continues.

    const metricsRecorder: FlowRecorder = {
    id: 'metrics',
    onLoop: (event) => recordMetric('loop.iteration', event.iteration),
    onDecision: (event) => recordMetric('decision', event.chosen),
    };
    executor.attachFlowRecorder(metricsRecorder);
    interface FlowRecorder {
        id: string;
        clear?(): void;
        onAttempt?(event: FlowAttemptEvent): void;
        onBreak?(event: FlowBreakEvent): void;
        onDecision?(event: FlowDecisionEvent): void;
        onError?(event: FlowErrorEvent): void;
        onFork?(event: FlowForkEvent): void;
        onLoop?(event: FlowLoopEvent): void;
        onNext?(event: FlowNextEvent): void;
        onPause?(event: FlowPauseEvent): void;
        onResume?(event: FlowResumeEvent): void;
        onRunEnd?(event: FlowRunEvent): void;
        onRunFailed?(event: FlowRunFailedEvent): void;
        onRunStart?(event: FlowRunEvent): void;
        onSelected?(event: FlowSelectedEvent): void;
        onStageExecuted?(event: FlowStageEvent): void;
        onStageRetry?(event: FlowStageRetryEvent): void;
        onSubflowEntry?(event: FlowSubflowEvent): void;
        onSubflowExit?(event: FlowSubflowEvent): void;
        onSubflowRegistered?(event: FlowSubflowRegisteredEvent): void;
        onThrottled?(event: FlowThrottledEvent): void;
        toSnapshot?(): RecorderBundle;
    }

    Implemented by

    Index
    id: string
    • Called once per top-level executor.run() AFTER traversal completes cleanly. Carries event.payload = chart's return value. NOT fired on pause (the run didn't end) or uncaught error.

      Parameters

      Returns void

    • Called once per top-level executor.run() when the run throws a non-pause error, BEFORE the exception propagates. The TERMINAL counterpart to onRunEnd — lets a monitor close the run boundary on failure instead of waiting forever. NOT fired on pause.

      Parameters

      Returns void