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