Skip to main content

JobDispatcher

@forge/monorepo


@forge/monorepo / backend/src / JobDispatcher

Interface: JobDispatcher

Defined in: backend/src/runtime/index.ts:150

Durable job enqueue. Adapters: BullMQ, in-memory for tests.

Methods

enqueueRun()

enqueueRun(input): Promise<void>

Defined in: backend/src/runtime/index.ts:160

traceparent and enqueuedAt are the trace hop (#143).

On the port rather than smuggled through a side channel on the adapter, because the alternative was an instrumented wrapper remembering the last span it opened — which is wrong the moment two enqueues overlap, and overlapping enqueues are the normal case. Optional so every existing caller is unaffected and a job already sitting on the queue still runs; a job with no traceparent starts its own trace, which loses a link rather than a run.

Parameters

input
enqueuedAt?

string

runId

RunId

tenantId

TenantId

traceparent?

string

Returns

Promise<void>