-
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
Promise concurrency to nodejs #1707
Comments
You can use Node streams for that: const { Readable } = require('stream');
const Promise = require('bluebird'); // to compare
async function fn(arg) {
await Promise.resolve(); // simulate something async
return arg;
}
Promise.map([1,2,3,4,5], fn, { concurrency: 3 }).then(results => console.log(results))
// streams
Readable.from([1,2,3,4,5]).map(fn, { concurrency: 3 }).forEach(result => console.log(result)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(This issue tracker is only for bug reports or feature requests, if this is neither, please choose appropriate channel from http:https://bluebirdjs.com/docs/support.html)
Please answer the questions the best you
There is a feature that keeps me using bluebird
In Promise.map there is a
concurrency
propLooking
The text was updated successfully, but these errors were encountered: