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