Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-executor / server / DBOSChildSpawnerQueue

Class: DBOSChildSpawnerQueue

Defined in: packages/chaingraph-executor/server/implementations/dbos/DBOSChildSpawnerQueue.ts:35

DBOS Child Spawner Queue - Special task queue for spawning child executions

This queue uses DBOS messaging (DBOS.send) instead of DBOS.startWorkflow, allowing child executions to be spawned from within steps (where startWorkflow is not allowed).

Architecture:

  • Parent execution (in step) calls publishTask()
  • This sends message to 'child-spawner' workflow via DBOS.send()
  • Child spawner workflow receives message and starts child workflow
  • Child workflow runs independently

Benefits:

  • ⚡ Blazing fast: DBOS.send() is just a DB write (~1-2ms)
  • 🚀 Non-blocking: Parent doesn't wait for child to start
  • ✅ Allowed: DBOS.send() works from steps
  • 💾 Durable: Messages stored in PostgreSQL
  • 🔄 Reliable: Guaranteed delivery

Implements

Constructors

Constructor

new DBOSChildSpawnerQueue(): DBOSChildSpawnerQueue

Returns

DBOSChildSpawnerQueue

Methods

close()

close(): Promise<void>

Defined in: packages/chaingraph-executor/server/implementations/dbos/DBOSChildSpawnerQueue.ts:88

Close the queue (no-op for child spawner)

Returns

Promise<void>

Implementation of

ITaskQueue.close


consumeTasks()

consumeTasks(handler): Promise<void>

Defined in: packages/chaingraph-executor/server/implementations/dbos/DBOSChildSpawnerQueue.ts:72

Consume tasks (not supported for child spawner) Child spawning is handled by the dedicated spawner workflow

Parameters

handler

(task, context?) => Promise<void>

Returns

Promise<void>

Implementation of

ITaskQueue.consumeTasks


publishTask()

publishTask(task): Promise<void>

Defined in: packages/chaingraph-executor/server/implementations/dbos/DBOSChildSpawnerQueue.ts:44

Publish a task to the child spawner

This sends the task to the child spawner workflow via DBOS.send(), which is allowed from within steps.

Parameters

task

ExecutionTask

The execution task to spawn

Returns

Promise<void>

Implementation of

ITaskQueue.publishTask


stopConsuming()

stopConsuming(): Promise<void>

Defined in: packages/chaingraph-executor/server/implementations/dbos/DBOSChildSpawnerQueue.ts:81

Stop consuming tasks (no-op for child spawner)

Returns

Promise<void>

Implementation of

ITaskQueue.stopConsuming

Licensed under BUSL-1.1