refactor: use eslint plugin to sort imports
[poolifier.git] / tests / worker-files / cluster / testWorker.js
1 'use strict'
2 const { isMaster } = require('cluster')
3 const { ClusterWorker, KillBehaviors } = require('../../../lib')
4 const TestUtils = require('../../test-utils')
5 const { WorkerFunctions } = require('../../test-types')
6
7 function test (data) {
8 data = data || {}
9 data.function = data.function || WorkerFunctions.jsonIntegerSerialization
10 TestUtils.executeWorkerFunction(data)
11 return isMaster
12 }
13
14 module.exports = new ClusterWorker(test, {
15 maxInactiveTime: 500,
16 killBehavior: KillBehaviors.HARD
17 })