Skip to content
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

add jobs to queues without creating separate Queue object #423

Closed
andrisi opened this issue Mar 10, 2021 · 3 comments
Closed

add jobs to queues without creating separate Queue object #423

andrisi opened this issue Mar 10, 2021 · 3 comments

Comments

@andrisi
Copy link

andrisi commented Mar 10, 2021

Is there a case for a BullMQ class perhaps with a method to add job/jobs to any queue? From the producer side it would simplify clients if we don't need notifications per queue, and even that could be part of this higher level API. I know, I can reuse the connection, so in essence this connection is used as a higher level API, creating/destroying Queue classes using it as we need to add jobs.

@manast
Copy link
Contributor

manast commented Mar 12, 2021

A Queue instance only requires one connection in order to add jobs to the queue. Events are handled in the QueueEvents class so if you don't need them no extra connections needed.

@andrisi
Copy link
Author

andrisi commented Mar 12, 2021

I'd need events too, preferably for all queues in one API (connection) but as you said, redis connections are "cheap" so no problem. Perhaps it is something to think about for the BullMQ module for redis: a not per-queue API. Thanks.

@andrisi andrisi closed this as completed Mar 12, 2021
@manast
Copy link
Contributor

manast commented Mar 12, 2021

I'd need events too, preferably for all queues in one API (connection) but as you said, redis connections are "cheap" so no problem. Perhaps it is something to think about for the BullMQ module for redis: a not per-queue API. Thanks.

In the redis BullMQ module you can use multiple queues with the same connection, however some operations are blocking so while they are blocked you cannot use that same connection for other operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants