Adding flows in bulk
import { FlowProducer } from 'bullmq';
const flow = new FlowProducer({ connection });
const trees = await flow.addBulk([
{
name: 'root-job-1',
queueName: 'rootQueueName-1',
data: {},
children: [
{
name,
data: { idx: 0, foo: 'bar' },
queueName: 'childrenQueueName-1',
},
],
},
{
name: 'root-job-2',
queueName: 'rootQueueName-2',
data: {},
children: [
{
name,
data: { idx: 1, foo: 'baz' },
queueName: 'childrenQueueName-2',
},
],
},
]);Read more:
Last updated
Was this helpful?