`worker${extname(fileURLToPath(import.meta.url))}`
)
-export const fixedPool = new FixedThreadPool<MyData, MyResponse>(
+const fixedPool = new FixedThreadPool<MyData, MyResponse>(
availableParallelism(),
workerFile,
{
}
)
-export const dynamicPool = new DynamicThreadPool<MyData, MyResponse>(
+await fixedPool.execute()
+
+const dynamicPool = new DynamicThreadPool<MyData, MyResponse>(
Math.floor(availableParallelism() / 2),
availableParallelism(),
workerFile,
}
)
+await dynamicPool.execute()
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
setTimeout(async () => {
await fixedPool.destroy()