Commit | Line | Data |
---|---|---|
8139fbbc | 1 | 'use strict' |
fcfc3353 | 2 | const { KillBehaviors, ClusterWorker } = require('../../../lib/index.cjs') |
8139fbbc JB |
3 | const { |
4 | factorial, | |
5 | fibonacci, | |
6 | jsonIntegerSerialization | |
7 | } = require('../../test-utils.cjs') | |
8 | ||
fcfc3353 | 9 | module.exports = new ClusterWorker( |
8139fbbc JB |
10 | { |
11 | jsonIntegerSerialization: { | |
12 | taskFunction: data => jsonIntegerSerialization(data.n) | |
13 | }, | |
14 | factorial: { taskFunction: data => factorial(data.n) }, | |
fcfc3353 | 15 | fibonacci: { taskFunction: data => fibonacci(data.n), priority: -5 } |
8139fbbc JB |
16 | }, |
17 | { | |
18 | killBehavior: KillBehaviors.HARD, | |
19 | maxInactiveTime: 500 | |
20 | } | |
21 | ) |