Skip to content

CaptureQueue

Defined in: packages/core/src/adapters/capture-queue.ts:73

A capture job queue, decoupled from the runtime.

enqueue submits a build for capture and returns quickly; the build is tracked as “queued”. The capture itself runs in a worker:

  • the in-memory implementation (InMemoryCaptureQueue, in capture/capture-queue.ts) runs the job in-process on a long-lived Node server;
  • a remote implementation (e.g. SQS, Cloudflare Queues, Azure Storage Queues) pushes the job and leaves execution to a separately-assembled worker that polls the queue and runs executeCaptureJob.

status/active/recent back the live queue view regardless of transport.

  • Adapter<{ category: "capture-queue"; }>

readonly optional lifecycle?: AdapterLifecycle

Defined in: packages/core/src/adapters/metadata.ts:84

Optional lifecycle hooks.

Adapter.lifecycle


readonly metadata: AdapterMetadata & object

Defined in: packages/core/src/adapters/metadata.ts:82

Adapter identity (mandatory).

readonly category: "capture-queue"

Adapter.metadata

active(): Promise<QueueEntry[]>

Defined in: packages/core/src/adapters/capture-queue.ts:79

Queue entries that are queued or running.

Promise<QueueEntry[]>


optional cancel(id): Promise<boolean>

Defined in: packages/core/src/adapters/capture-queue.ts:87

Cancel by job id, or every unfinished job of a build by build id (every job kind of the build on the database queue). Optional. A job that has not started ends cancelled at once; a running one is flagged, and its holder sees "cancelled" from extend/inspect. Resolves true when anything matched.

string

Promise<boolean>


enqueue(job): Promise<void>

Defined in: packages/core/src/adapters/capture-queue.ts:75

Submit a build for capture. Resolves once the build is queued.

CaptureJob

Promise<void>


recent(limit): Promise<QueueEntry[]>

Defined in: packages/core/src/adapters/capture-queue.ts:81

The most recent queue entries, newest first.

number

Promise<QueueEntry[]>


optional setLogger(logger): void

Defined in: packages/core/src/adapters/metadata.ts:90

Bind the host-owned runtime logger. Called by the app/worker when present; factories must never create their own loggers — they only store what they are given (explicit options.logger wins over bound).

Logger

void

Adapter.setLogger


status(buildId): Promise<QueueEntry | null>

Defined in: packages/core/src/adapters/capture-queue.ts:77

Return the current status entry for a build, or null if untracked.

string

Promise<QueueEntry | null>