-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feature request and one question #5
Comments
Thanks for your input. I'll look into whether reserving multiple jobs is possible but I don't see why it wouldn't if you use |
Thanks for the reply. Bsw is doing something like this. Since nodejs is single threaded, it reserves jobs and increases I really didn't know how cluster can be used in here. Isn't cluster designed for network processes? I don't know how this issue can be tackled with clustering. Those processes don't need any communication. Isn't is same as just forking many workers as we want? If we fork lots of processes, we will increase memory load. However if we reserve many jobs inside the same process, we will basically do the same thing without the memory overhead. Please let me know if I am wrong. Best regards. |
Here's the documentation for
In the current README.md there's a small section that talks about the worker pattern where, essentially, you use a For instance, if you have eight logical CPUs, you can spin up eight workers so that each of them processes one job at a time, etc. Please keep in mind that clustering and multi-threading is outside of the scope of this package and the documentation for it. Hope this helps. |
To give a concise answer to your question: we will not be implementing multiple job reservation in this library because it is outside of the scope of this library. If you are reserving multiple jobs at the same time within the same Node.js process, you're probably doing something wrong. Spin up many Node.js processes or start a cluster of workers within one process. |
Thanks for detailed answer. I still think that there are use cases for multiple job reservations in a single process. If let's say you're connecting to multiple web sites and scraping data. Each site needs different extraction logic. If you use single job only, you will request one web site at a time. However with multiple job reservations you can fire 10 requests to websites at a time. Spinning multiple workers just increases memory. I totally understand your reasoning though. Thanks once again for detailed answers. Best regards. |
Sorry for necroing this thread, but this should be answered for anyone thinking about multithreading in the future. Based on Because of this limitation, you probably should not share one However, if you really want to use one |
Feature Request
I loved the simplicity and elegance of this library. I am planning to abandon fivebeans and switch to this one. I will appreciate if you can increase the documentation add some information about keeping connection, re-connecting etc.
Question
Is it possible to reserve multiple jobs with the worker pattern? Instead of forking lots of processes with
while (true) {}
, is it possible to do some parallel processing? Because another fivebeans based library named bsw has a feature that allows processing multiple jobs.The text was updated successfully, but these errors were encountered: