X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fcluster-worker.mjs;h=fee9d3f8b5cbddccd17d58dc4b95cbaf2a5cb8d8;hb=8c25f12d41260092a30cfb47feeb662140943302;hp=efbcf7b1cfd0bbf60c126f8f5af716b3c6a7dd45;hpb=dbca3be954130834defeb4084096272ecf660c5c;p=poolifier.git diff --git a/benchmarks/internal/cluster-worker.mjs b/benchmarks/internal/cluster-worker.mjs index efbcf7b1..fee9d3f8 100644 --- a/benchmarks/internal/cluster-worker.mjs +++ b/benchmarks/internal/cluster-worker.mjs @@ -1,15 +1,15 @@ -import { isMaster } from 'cluster' +import { isPrimary } from '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 }