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