96b861c44bf2127f1d9d55c521cfb4e244590dc7
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')