'./yourWorker.js',
{ errorHandler: (e) => console.error(e), onlineHandler: () => console.log('worker is online') })
-pool.emitter.on('busy', () => console.log('Pool is full'))
+pool.emitter.on('busy', () => console.log('Pool is busy'))
// the execute method signature is the same for both implementations,
// so you can easy switch from one to another
resolved++
if (resolved === iterations) {
console.log('Time take is ' + (Date.now() - start))
- return console.log('The pool was full for ' + maxReached + ' times')
+ return console.log('The pool was busy for ' + maxReached + ' times')
}
return null
})