Add fair sharing worker choice strategy
[poolifier.git] / benchmarks / internal / cluster / worker.js
CommitLineData
57df5469 1'use strict'
23ff945a 2const { isMaster } = require('cluster')
be0676b3 3const { ClusterWorker } = require('../../../lib/index')
bdacc2d2 4const { jsonIntegerSerialization } = require('../benchmark-utils')
57df5469 5
23ff945a
JB
6const debug = false
7
106744f7 8function yourFunction (data) {
bdacc2d2 9 jsonIntegerSerialization(1000)
23ff945a 10 debug === true && console.debug('This is the main thread ' + isMaster)
106744f7 11 return { ok: 1 }
12}
13
325f50bc 14module.exports = new ClusterWorker(yourFunction)