Skip to content
Français

RunObserver

import type { RunObserver } from "@elie-laloum/outpost/observation";
  • errorsRequired
    readonly unknown[]
    First receiver failure, including asynchronous heartbeat or storage errors; independent of execution outcome.
  • closeRequired
    () => Promise<void>
    Stop heartbeats and await queued writes; idempotent, throws the stored failure and does not invent a terminal execution status.
  • [Symbol.asyncDispose]Required
    () => Promise<void>
    Close the receiver when leaving an await using scope.
  • observeRequired
    (observation: Observation) => void | Promise<void>
    Receive one envelope; returned promises are serialized per sink and rejection is isolated from execution.
  • flushOptional
    (() => void | Promise<void>) | undefined
    Drains the receiver’s own buffer; the hub calls it from flush() with its delivery timeout.
export interface RunObserver extends ObservationSink {
  readonly errors: readonly unknown[];
  close(): Promise<void>;
  [Symbol.asyncDispose](): Promise<void>;
}