2 const { isMaster
} = require('cluster')
3 const { ClusterWorker
} = require('../../lib')
4 const { executeWorkerFunction
} = require('../benchmarks-utils')
5 const { WorkerFunctions
} = require('../benchmarks-types')
9 function yourFunction (data
) {
11 data
.function = data
.function || WorkerFunctions
.jsonIntegerSerialization
12 executeWorkerFunction(data
)
13 debug
=== true && console
.debug('This is the main thread ' + isMaster
)
17 module
.exports
= new ClusterWorker(yourFunction
)