Pausing queues
BullMQ supports pausing queues globally or locally. When a queue is paused globally no workers will pick up any jobs from the queue. When you pause a queue, the workers that are currently busy processing a job will continue working on that job until it completes (or fails), and then will keep idling until the queue is unpaused.
Pausing a queue is performed by calling the pause method on a queue instance:
await myQueue.pause();await my_queue.pause():ok = BullMQ.Queue.pause("my-queue", connection: :my_redis)await myQueue.PauseAsync();my_queue.pause().await?;$myQueue->pause();It is also possible to locally pause a given worker instance. This pause works in a similar way as the global pause in the sense that the worker will conclude processing the jobs it has already started but will not process any new ones:
await myWorker.pause();await my_worker.pause():ok = BullMQ.Worker.pause(my_worker)my_worker.pause();TypeScript and Python wait for active jobs to complete (or fail) when pausing a worker. Rust and Elixir pause calls return immediately while active jobs continue running. Rust has no force option, and Elixir's force option currently has no effect.
In TypeScript and Python, pass true to return immediately while current jobs continue running:
await myWorker.pause(true);await my_worker.pause(True)