Skip to content
Français

readRun

import { readRun } from "@elie-laloum/outpost/observation";

Read and validate one atomically published execution snapshot without an execution lock. Return undefined for a missing ID. Derive abandoned and complete false when a running heartbeat has expired, without persisting that status or changing resource ownership. Stored observations can lag or be lost; this is not a checkpoint.

Complete example and detailed rules.

  • optionsRequired
    ReadRunOptions
    Transport and execution ID with optional cancellation and per-object byte bound.
  • options.transporterRequired
    Transport
    Transport targeting the same location as the execution receiver.
  • options.idRequired
    string
    Application-selected run ID to read without taking execution ownership.
  • options.signalOptional
    AbortSignal | undefined
    Cancel transport reads and watch polling only; never cancels the observed execution.
  • options.maxBytesOptional
    number | undefined
    Per-object read limit in bytes, default 8388608; oversized snapshots or event segments fail.

Promise<RunSnapshot | undefined>

export declare function readRun(
  options: ReadRunOptions,
): Promise<RunSnapshot | undefined>;