Merge pull request #153 from pioardi/add-worker-test
[poolifier.git] / tests / worker-files / cluster / testWorker.js
1 'use strict'
2 const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
3 const { isMaster } = require('cluster')
4
5 function test (data) {
6 for (let i = 0; i <= 50; i++) {
7 const o = {
8 a: i
9 }
10 JSON.stringify(o)
11 }
12 return isMaster
13 }
14
15 module.exports = new ClusterWorker(test, {
16 maxInactiveTime: 500,
17 killBehavior: KillBehaviors.HARD
18 })