build(deps-dev): apply updates
[poolifier.git] / tests / worker-files / cluster / testTaskFunctionObjectsWorker.cjs
1 'use strict'
2 const { KillBehaviors, ThreadWorker } = require('../../../lib/index.cjs')
3 const {
4 factorial,
5 fibonacci,
6 jsonIntegerSerialization
7 } = require('../../test-utils.cjs')
8
9 module.exports = new ThreadWorker(
10 {
11 jsonIntegerSerialization: {
12 taskFunction: data => jsonIntegerSerialization(data.n)
13 },
14 factorial: { taskFunction: data => factorial(data.n) },
15 fibonacci: { taskFunction: data => fibonacci(data.n) }
16 },
17 {
18 killBehavior: KillBehaviors.HARD,
19 maxInactiveTime: 500
20 }
21 )