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
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
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
The execution task to spawn
Returns
Promise<void>
Implementation of
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>