2 const { isMainThread
} = require('worker_threads')
3 const { ThreadWorker
} = require('../../lib')
4 const { executeWorkerFunction
} = require('../benchmarks-utils')
5 const { WorkerFunctions
} = require('../benchmarks-types')
9 function yourFunction (data
) {
11 data
.function = data
.function || WorkerFunctions
.jsonIntegerSerialization
12 executeWorkerFunction(data
)
13 debug
=== true && console
.debug('This is the main thread ' + isMainThread
)
17 module
.exports
= new ThreadWorker(yourFunction
)