X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=benchmarks%2Finternal%2Fcluster-worker.mjs;h=2ec78054e655f25f181e888c0f90b6bd28ba4b66;hb=1adc6af72c087b9412e625bc9576be67d40e7397;hp=50e4a324a98a580206db83a3dc3dc40bf80efc32;hpb=8f810074232deefe64634a8942b1db5b8d3bb0dc;p=poolifier.git diff --git a/benchmarks/internal/cluster-worker.mjs b/benchmarks/internal/cluster-worker.mjs index 50e4a324..2ec78054 100644 --- a/benchmarks/internal/cluster-worker.mjs +++ b/benchmarks/internal/cluster-worker.mjs @@ -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)