You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an existing issue that is already proposing this?
I have searched the existing issues
Is your feature request related to a problem? Please describe it
I've recently integrated bullmq to my nestjs application using the @nestjs/bullmq module and I have a small problem.
My application is a multi-tenant application, and the app is loading the tenants dynamically when the application starts (inside OnModuleInit), the app also using Kafka and we've developed a custom module for multi-tenant communication thought Kafka, and there's another OnApplicationBootstrap function.
As soon as the BullExplorerOnModuleInit is finished the processors are taking jobs from the queue and I'm missing controls to tell the processors when they can start taking jobs, since I need those logics to finish first.
I tried to resolve the processors (app.resolve) after the app has started and call XXXprocessor.worker.pause() but I'm getting an error that I can't interact with the worker.
Describe the solution you'd like
I want to decide when my application starts processing jobs from the queue
@kamilmysliwiec I'm wondering how it's best to implement this.
bullmq worker can accept autorun: false, but then somehow I need to tell the worker to start running.
I'm not sure how to implement this for all processors and event-listeners, like a high-level autorun.
What do you think about exposing an option in QueueOptions for not running any logic in BullExplorer.onModuleInit and then exposing the registration logic ( this.registerWorkers(); this.registerQueueEventListeners(); ) to the developer to run?
I know it's a naive solution but it's simple to implement and gives the developer a simple way to tell all processors and event-listeners to run.
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
I've recently integrated bullmq to my nestjs application using the
@nestjs/bullmq
module and I have a small problem.My application is a multi-tenant application, and the app is loading the tenants dynamically when the application starts (inside
OnModuleInit
), the app also using Kafka and we've developed a custom module for multi-tenant communication thought Kafka, and there's anotherOnApplicationBootstrap
function.As soon as the
BullExplorer
OnModuleInit
is finished the processors are taking jobs from the queue and I'm missing controls to tell the processors when they can start taking jobs, since I need those logics to finish first.I tried to resolve the processors (
app.resolve
) after the app has started and callXXXprocessor.worker.pause()
but I'm getting an error that I can't interact with the worker.Describe the solution you'd like
I want to decide when my application starts processing jobs from the queue
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
because my app is loading the tenants data dynamically, the app isn't ready for processing jobs right away
The text was updated successfully, but these errors were encountered: