X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fcluster-worker.mjs;h=69a7ad15cae0ada671f3e4f8ef1261305d26e51a;hb=a407a312c70217a9fd82e13dd61a6bfdb6fb7439;hp=efbcf7b1cfd0bbf60c126f8f5af716b3c6a7dd45;hpb=dbca3be954130834defeb4084096272ecf660c5c;p=poolifier.git diff --git a/benchmarks/internal/cluster-worker.mjs b/benchmarks/internal/cluster-worker.mjs index efbcf7b1..69a7ad15 100644 --- a/benchmarks/internal/cluster-worker.mjs +++ b/benchmarks/internal/cluster-worker.mjs @@ -1,15 +1,15 @@ -import { isMaster } from 'cluster' +import { isPrimary } from 'node:cluster' import { ClusterWorker } from '../../lib/index.mjs' import { executeTaskFunction } from '../benchmarks-utils.mjs' import { TaskFunctions } from '../benchmarks-types.mjs' const debug = false -function taskFunction (data) { +const taskFunction = data => { data = data || {} data.function = data.function || TaskFunctions.jsonIntegerSerialization const res = executeTaskFunction(data) - debug === true && console.debug('This is the main thread ' + isMaster) + debug === true && console.debug(`This is the main thread ${isPrimary}`) return res }