Commit | Line | Data |
---|---|---|
57df5469 | 1 | 'use strict' |
23ff945a | 2 | const { isMaster } = require('cluster') |
be0676b3 | 3 | const { ClusterWorker } = require('../../../lib/index') |
bdacc2d2 | 4 | const { jsonIntegerSerialization } = require('../benchmark-utils') |
57df5469 | 5 | |
23ff945a JB |
6 | const debug = false |
7 | ||
106744f7 | 8 | function 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 | 14 | module.exports = new ClusterWorker(yourFunction) |