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