Is there a way/pattern to implement let res = Promise.all([...p], limit)?
- The promise-array holds functions which construct and return the promise
resshould be resolved after allpresolves- Only
limit=3Promises should run in parallel - The n+1th Promise should start immediately after n finishes. So that there are always
limitresolvers running in parallel.
Especially the last point creates my headaches.
My current solution is to split the promises-array into chunks of limit size and chain them. The disadvantages here is that the second bunch don't start until all Promises from bunch 1 has been resolved.