-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Implements concurrency pool for Bluebird.maps() #1637
Comments
Regarding your first example, what should happen when the outer map eats up all available resources from the pool and the inner map gets an empty pool? |
The outer map won't close until all of his child get resolved.. In the worst case the outer loop stay running because a single task is not completer, |
Why not simply use https://github.com/ForbesLindesay/throat instead? |
it should work... |
Hi,
This is a code pattern I have commonly:
With the current Bluebird
this code can start up to 50 x 50 concurrent calls to the API.
with a 4 level loop, the concurrency value can be 20 x 20 x 20 x 20
but allowing 160 000 concurrent can will blow up the nodejs process.
A real life 3 level sample can be found here:
If the ids array size vary a lots from empty / tiny to very large, there is no way to have a constant processing speed.
it's possible to refactor this code to improve linear performances, by preloading each level of API call, but that force me to pre-load each API layer in memory.
in java I can use
Executors.newFixedThreadPool(max_threads);
to fix a number of parallels threads.With some new features
something like:
to limit the number of concurrent task to 250.
or
In this case:
The text was updated successfully, but these errors were encountered: