Adding jobs in bulk across different queues
Sometimes it is necessary to atomically add jobs to different queues in bulk. For example, there could be a requirement that all the jobs must be created or none of them. Also, adding jobs in bulk can be faster, since it reduces the number of roundtrips to Redis:
You may be think of queue.addBulk
, but this method only adds jobs to a single queue. Another option is flowProducer.addBulk
, so let's see an example:
It is possible to add individual jobs without children.
This call can only succeed or fail, and all or none of the jobs will be added.
Read more:
Last updated