refactor: remove blank line
[poolifier.git] / benchmarks / internal / cluster-worker.mjs
index 2ec78054e655f25f181e888c0f90b6bd28ba4b66..fee9d3f8b5cbddccd17d58dc4b95cbaf2a5cb8d8 100644 (file)
@@ -1,16 +1,16 @@
-import { isMaster } from 'cluster'
+import { isPrimary } from 'cluster'
 import { ClusterWorker } from '../../lib/index.mjs'
-import { executeWorkerFunction } from '../benchmarks-utils.mjs'
-import { WorkerFunctions } from '../benchmarks-types.mjs'
+import { executeTaskFunction } from '../benchmarks-utils.mjs'
+import { TaskFunctions } from '../benchmarks-types.mjs'
 
 const debug = false
 
-function workerFunction (data) {
+const taskFunction = (data) => {
   data = data || {}
-  data.function = data.function || WorkerFunctions.jsonIntegerSerialization
-  const res = executeWorkerFunction(data)
-  debug === true && console.debug('This is the main thread ' + isMaster)
+  data.function = data.function || TaskFunctions.jsonIntegerSerialization
+  const res = executeTaskFunction(data)
+  debug === true && console.debug(`This is the main thread ${isPrimary}`)
   return res
 }
 
-export default new ClusterWorker(workerFunction)
+export default new ClusterWorker(taskFunction)