Benchmarks: remove debug code
[poolifier.git] / benchmarks / internal / cluster / worker.js
... / ...
CommitLineData
1'use strict'
2const { isMaster } = require('cluster')
3const { ClusterWorker } = require('../../../lib/index')
4const { WorkerFunctions, executeWorkerFunction } = require('../benchmark-utils')
5
6const debug = false
7
8function yourFunction (data) {
9 data = data || {}
10 data.function = data.function || WorkerFunctions.jsonIntegerSerialization
11 executeWorkerFunction(data)
12 debug === true && console.debug('This is the main thread ' + isMaster)
13 return { ok: 1 }
14}
15
16module.exports = new ClusterWorker(yourFunction)