8e7d4bb7fd981c3bc1e01b80e716374e70187c53
1 import { join
} from
"path";
2 import { DynamicThreadPool
, FixedThreadPool
} from
"poolifier";
3 import { MyData
, MyResponse
} from
"./worker";
5 export const fixedPool
= new FixedThreadPool
<MyData
, Promise
<MyResponse
>>(
7 join(__dirname
, "worker.js"),
9 errorHandler
: (e
) => console
.error(e
),
10 onlineHandler
: () => console
.log("Worker is online"),
14 export const dynamicPool
= new DynamicThreadPool
<MyData
, Promise
<MyResponse
>>(
17 join(__dirname
, "worker.js"),
19 errorHandler
: (e
) => console
.error(e
),
20 onlineHandler
: () => console
.log("Worker is online"),