-export const fixedPool = new FixedThreadPool<MyData, Promise<MyResponse>>(
- 8,
- join(__dirname, 'worker.js'),
+const workerFile = join(
+ dirname(fileURLToPath(import.meta.url)),
+ `worker${extname(fileURLToPath(import.meta.url))}`
+)
+
+export const fixedPool = new FixedThreadPool<MyData, MyResponse>(
+ availableParallelism(),
+ workerFile,