spawn-ts API reference - v0.6.0
    Preparing search index...

    Class SpawnClient

    Index
    • get backend(): { isReal: boolean; label: string }

      Returns { isReal: boolean; label: string }

    • Ids of fan-outs (sweeps + queues) still running.

      Returns string[]

    • Extend an instance's TTL deadline by a duration. Returns the new deadline (ms).

      Parameters

      • nameOrId: string
      • by: string | number

      Returns Promise<number>

    • Orphans among the currently-known instances: managed + live + past their TTL deadline by the grace window (spored should have reaped them but didn't — the #19 failure mode). Call refresh() first for fresh data. Pure detection; reaping is a separate, confirmed action (reapOrphans).

      Parameters

      • OptionalgraceMs: number

      Returns Orphan[]

    • Parameters

      • nameOrId: string

      Returns Promise<void>

    • Terminate the given orphans (or all currently-detected ones). Returns the instance ids terminated. The caller is responsible for confirming first — this always terminates. Emits an "info" event per reap and refreshes.

      Parameters

      Returns Promise<string[]>

    • Swap the compute backend at runtime (e.g. mock → real AWS from a creds form).

      Parameters

      Returns void

    • Set sim speed (mock only). 1 = realtime, 60 = 1 min/sec.

      Parameters

      • multiplier: number

      Returns void

    • Fire a completion signal (drops the watched file) to demo on-complete.

      Parameters

      • nameOrId: string

      Returns Promise<void>

    • Parameters

      • nameOrId: string

      Returns Promise<void>

    • Start a job array: N identical launches from one base input, each stamped with its index via the spawn:job-array-* tags, fanned out under the monitor loop (concurrency cap / launch delay). Returns the built JobArray; progress arrives via "jobarray" events. Same cost-safety guard as launch().

      Parameters

      Returns JobArray

    • Begin the monitor loop (ticks every intervalMs of wall time).

      Parameters

      • intervalMs: number = 250

      Returns void

    • Start a batch job queue: validate + order the config into a DAG of members and register a fan-out that the monitor loop pumps each tick, launching each job's instance as its dependencies complete and capacity allows. Returns the built Queue; progress arrives via "queue" events. Same cost-safety guard as launch() applies to a real backend.

      Parameters

      Returns Queue

    • Start a parameter sweep: expand the spec into members and register a fan-out that the monitor loop pumps each tick (launching members as the concurrency cap allows). Returns the built Sweep for identity/inspection. Progress is delivered via "sweep" events; call startMonitor() (or step() in tests) to drive it. A real launch inherits the same cost-safety guard as launch().

      Parameters

      Returns Sweep

    • Advance the sim clock by a duration and run one tick (mock only, for tests/step).

      Parameters

      • by: string | number

      Returns Promise<void>

    • Parameters

      • nameOrId: string
      • reason: string = "user request"

      Returns Promise<void>

    • Parameters

      • nameOrId: string
      • reason: string = "user request"

      Returns Promise<void>