refactor: make TS example compatible with latest ES version
[poolifier.git] / benchmarks / internal / cluster-worker.mjs
index 50e4a324a98a580206db83a3dc3dc40bf80efc32..2ec78054e655f25f181e888c0f90b6bd28ba4b66 100644 (file)
@@ -5,12 +5,12 @@ import { WorkerFunctions } from '../benchmarks-types.mjs'
 
 const debug = false
 
-function yourFunction (data) {
+function workerFunction (data) {
   data = data || {}
   data.function = data.function || WorkerFunctions.jsonIntegerSerialization
-  executeWorkerFunction(data)
+  const res = executeWorkerFunction(data)
   debug === true && console.debug('This is the main thread ' + isMaster)
-  return { ok: 1 }
+  return res
 }
 
-export default new ClusterWorker(yourFunction)
+export default new ClusterWorker(workerFunction)