1 async
function runPoolifierTest (pool
, { tasks
, workerData
}) {
2 return new Promise((resolve
, reject
) => {
4 for (let i
= 1; i
<= tasks
; i
++) {
9 if (executions
=== tasks
) {
10 return resolve('FINISH')
14 .catch(err
=> console
.error(err
))
19 function generateRandomInteger (max
, min
= 0) {
21 return Math
.floor(Math
.random() * (max
- min
+ 1) + min
)
23 return Math
.floor(Math
.random() * max
+ 1)
26 const LIST_FORMATTER
= new Intl
.ListFormat('en-US', {
31 module
.exports
= { generateRandomInteger
, LIST_FORMATTER
, runPoolifierTest
}