4 ms·
const results = await Promise.map(urls, url => process(url), { concurrency: 8 }) You can find a "map with concurrency limit" implementation in Bluebird (shown)
by always_good 8y ago
const results = await Promise.map(urls, url => process(url), { concurrency: 8 })
You can find a "map with concurrency limit" implementation in Bluebird (shown) or standalone on NPM.
For example, off the top of my head this would probably take me 40 lines of ungeneral wait group code in Go.