Comment on page
eachParallelLimit
snc.eachParallelLimit(iterable_array, number_limit, callback_loop(item, index, next_method), callback_end(data))
Runs in parallel limit and next loop when "next" method is executed. Alternative names: eachpl, epl.
const list = ['a', 'b', 'c', 'd']
snc.epl(list, 2, (item, index, next) => {
console.log(`item: ${item}`)
setTimeout(next, 2000)
},
() => {
console.log(`End`)
})
-> item: a
-> item: b
-> item: c // Next to start when next method executed;
-> item: d // Next to start when next method executed;
-> End
Last modified 3yr ago