Add fair sharing worker choice strategy
[poolifier.git] / benchmarks / internal / thread / worker.js
CommitLineData
57df5469 1'use strict'
23ff945a 2const { isMainThread } = require('worker_threads')
be0676b3 3const { ThreadWorker } = 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 ' + isMainThread)
106744f7 11 return { ok: 1 }
12}
13
1f9a5a44 14module.exports = new ThreadWorker(yourFunction)