1 import { isMainThread } from 'node:worker_threads'
2 import { ThreadWorker } from '../../lib/index.mjs'
3 import { executeTaskFunction } from '../benchmarks-utils.cjs'
4 import { TaskFunctions } from '../benchmarks-types.cjs'
6 const taskFunction = data => {
8 data.function = data.function || TaskFunctions.jsonIntegerSerialization
9 data.debug = data.debug || false
10 const res = executeTaskFunction(data)
11 data.debug === true &&
12 console.debug(`This is the main thread ${isMainThread}`)
16 export default new ThreadWorker(taskFunction)