Are there any differences in execution when I use async.parallel()
(the NPM async module) and Promise.all()
? Both of them say that they start the callbacks/promises in parallel without waiting for the previous one to finish. So, can I use them interchangeably?
As far as I can tell they both will error as soon as a single promise is rejected. I would say the main differences are that:
Promise.all
is native Javascript, so no package is requiredasync.parallel
has a more flexible call signature in that you can pass an object of tasks and get back an object of results. Also, if you find yourself needing concurrency limits you can easily switch over to async.parallelLimit