The function sequenceWithParallelismin the bluebird-as extension seems to be designed specifically for the functions you want. As it is written, a blue bird is used to implement it, but I do not see anything specific for blue birds in the actual contents of the function sequenceWithParallelism, so you can simply extract this function and use it in your own code, for example:
sequenceWithParallelism(limit, f => f())([..p])
.then(function () {
});
Oddly enough, the function does not seem to be intended to resolve the results of all promises, so if you need it, you probably need to make a few changes.
source
share