-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Question: reusing Redis bclient #880
Comments
From my experience, The 3 types I've seen are |
@ritter Good to know, thanks. Also you're right; I definitely meant |
bclient cannot be shared because it is the client used for blocking calls, so if one instance for instance blocks it waiting for jobs to arrive to the queue, all the other instance sharing it will stall. |
@manast Makes sense, thanks for the super fast reply! |
In regards to sharing redis connections, we are sharing |
Bit of extra info for future readers: the relevant source is at https://github.com/OptimalBits/bull/blob/develop/lib/queue.js#L1098
When a queue is empty, that queue opens a blocking connection to redis to wait for the next item to be added to the queue. That connection is then kept around as "the blocking connection to use next time this same queue is empty". Hence the need for one blocking connection per queue. I've opened up a PR to make this more clear in the example code for re-using connections: #1714 |
Hello!
In PATTERNS.md it says that bull requires 3 connections, and lists two types -
client
andserver
subscriber
. I noticed that there's also abclient
type that gets passed tocreateClient
. Can this connection be reused as well, or is that not advised?Thanks in advance!
The text was updated successfully, but these errors were encountered: