-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controls for nestjs/bullmq processors in request-scoped providers #2030
Comments
Would you like to create a PR for this issue? |
@kamilmysliwiec I'm wondering how it's best to implement this. What do you think about exposing an option in |
I think that's OK. Then we could expose a |
Let's track this here #2038 |
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: