Function: dag()
ts
function dag(
nodes,
connection,
prefix?): Promise<Map<string, Job<any, any>>>;Defined in: glide-mq/src/workflows.ts:165
DAG: submit a directed acyclic graph of jobs where each job can depend on multiple other jobs. The graph is validated for cycles and submitted in topological order (leaves first).
Returns a Map of node name to Job instance.
Example - diamond dependency:
const jobs = await dag([
{ name: 'A', queueName: 'q', data: {}, deps: [] },
{ name: 'B', queueName: 'q', data: {}, deps: ['A'] },
{ name: 'C', queueName: 'q', data: {}, deps: ['A'] },
{ name: 'D', queueName: 'q', data: {}, deps: ['B', 'C'] },
], connection);Parameters
| Parameter | Type |
|---|---|
nodes | DAGNode[] |
connection | ConnectionOptions |
prefix? | string |
Returns
Promise<Map<string, Job<any, any>>>