s
s
snc
Search…
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.
1
const list = ['a', 'b', 'c', 'd']
2
snc.epl(list, 2, (item, index, next) => {
3
console.log(`item: ${item}`)
4
setTimeout(next, 2000)
5
},
6
() => {
7
console.log(`End`)
8
})
Copied!
1
-> item: a
2
-> item: b
3
-> item: c // Next to start when next method executed;
4
-> item: d // Next to start when next method executed;
5
-> End
Copied!
Copy link