1 const { DynamicThreadPool
} = require('../../lib/index')
5 const dynamicPool
= new DynamicThreadPool(size
/ 2, size
* 3, './worker.js', {
9 async
function dynamicThreadTest (
10 { tasks
, workerData
} = { tasks
: 1, workerData
: { proof
: 'ok' } }
12 return new Promise((resolve
, reject
) => {
14 for (let i
= 0; i
<= tasks
; i
++) {
19 if (executions
=== tasks
) {
20 return resolve('FINISH')
24 .catch(err
=> console
.error(err
))
29 module
.exports
= { dynamicThreadTest
}