X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fcluster%2Fworker.js;h=926278be77e4484fbbd9200af2b48fa76db27f26;hb=ffe8ca52bf1a05f68a0c939d16f15b6b54028be9;hp=0235afface236f2e2492e669636d74df37770c81;hpb=23ff945ac0bc3b9bcf98c6491872cffaac805b73;p=poolifier.git diff --git a/benchmarks/internal/cluster/worker.js b/benchmarks/internal/cluster/worker.js index 0235affa..926278be 100644 --- a/benchmarks/internal/cluster/worker.js +++ b/benchmarks/internal/cluster/worker.js @@ -1,12 +1,15 @@ 'use strict' const { isMaster } = require('cluster') const { ClusterWorker } = require('../../../lib/index') -const { jsonIntegerSerialization } = require('../benchmark-utils') +const { executeWorkerFunction } = require('../../benchmarks-utils') +const { WorkerFunctions } = require('../../benchmarks-types') const debug = false function yourFunction (data) { - jsonIntegerSerialization(1000) + data = data || {} + data.function = data.function || WorkerFunctions.jsonIntegerSerialization + executeWorkerFunction(data) debug === true && console.debug('This is the main thread ' + isMaster) return { ok: 1 } }