s
s
snc
Search…
⌃K

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