Skip to content

Release 1.2.5

Compare
Choose a tag to compare
@warlock warlock released this 29 Nov 14:12
· 15 commits to master since this release

Add new function:

snc.foreverParallel(limit, callback(counter, done), callback_end(data))**

Forever loop with parallel limit.
Alternative name: fp.

snc.fp(2, (counter, done, end) => {
console.log(counter)
if (counter < 6 ) {
setTimeout(() => {
done()
}, 3000)
} else end('bye!')
},
res => {
console.log(`END: ${res}`)
})
-> 1
-> 2
-> 3 // Wait 3 seconds
-> 4 // Wait 3 seconds
-> 5 // Wait 6 seconds
-> 6 // Wait 6 seconds
-> 7 // Wait 9 seconds
-> END: bye bye! // Wait 9 seconds