Queue management #2927
-
I use Nest Js. In order to work with a queue, i need to register it in a module:
It works great when you just need to use this queue in a single module. Although I have to delete all user's jobs from different queues in a seperate module. It means I need to register those queues in a seperate module which is responsible for deletion. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The best would be if you ask this in the nest/bullmq repo, as this team is not responsible for the nest module and we are not so familiar with it. |
Beta Was this translation helpful? Give feedback.
I found the answer here. https://stackoverflow.com/questions/75205587/bullmq-add-jobs-to-queues-from-different-service-to-worker. So basically we can easily register the same queue in different places, because queue is an instance of facade class that serves as an api to add jobs to queues in Redis, not the queue itself.
So it's ok for each service to have their own instance of such facade, as the source of truth is Redis.