if (executions === taskExecutions) {
resolve({ ok: 1 })
}
- return null
+ return undefined
})
.catch(err => {
console.error(err)
const runPoolifierPoolBenchmark = async (
name,
- pool,
+ workerType,
+ poolType,
+ poolSize,
{ taskExecutions, workerData }
) => {
+ const pool = buildPoolifierPool(workerType, poolType, poolSize)
+ const suite = new Benchmark.Suite(name)
return await new Promise((resolve, reject) => {
try {
- const suite = new Benchmark.Suite(name)
for (const workerChoiceStrategy of Object.values(
WorkerChoiceStrategies
)) {
})
.run({ async: true })
} catch (error) {
- reject(error)
+ pool
+ .destroy()
+ .then(() => {
+ return reject(error)
+ })
+ .catch(() => {})
}
})
}
module.exports = {
LIST_FORMATTER,
- buildPoolifierPool,
executeTaskFunction,
generateRandomInteger,
runPoolifierPoolBenchmark