build(deps-dev): apply updates
[poolifier.git] / benchmarks / internal / thread-worker.js
CommitLineData
57df5469 1'use strict'
23ff945a 2const { isMainThread } = require('worker_threads')
cdace0e5
JB
3const { ThreadWorker } = require('../../lib')
4const { executeWorkerFunction } = require('../benchmarks-utils')
5const { WorkerFunctions } = require('../benchmarks-types')
57df5469 6
23ff945a
JB
7const debug = false
8
106744f7 9function yourFunction (data) {
2d2e32c2
JB
10 data = data || {}
11 data.function = data.function || WorkerFunctions.jsonIntegerSerialization
12 executeWorkerFunction(data)
23ff945a 13 debug === true && console.debug('This is the main thread ' + isMainThread)
106744f7 14 return { ok: 1 }
15}
16
1f9a5a44 17module.exports = new ThreadWorker(yourFunction)