repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chore: v2.6.25
[poolifier.git]
/
benchmarks
/
internal
/
cluster-worker.mjs
diff --git
a/benchmarks/internal/cluster-worker.mjs
b/benchmarks/internal/cluster-worker.mjs
index e8d16d217313457bffccb269642644207d1292f0..60876bebef04bf97e3a866209fe65792bf6d985f 100644
(file)
--- a/
benchmarks/internal/cluster-worker.mjs
+++ b/
benchmarks/internal/cluster-worker.mjs
@@
-1,16
+1,16
@@
import { isMaster } from 'cluster'
import { ClusterWorker } from '../../lib/index.mjs'
import { isMaster } from 'cluster'
import { ClusterWorker } from '../../lib/index.mjs'
-import { execute
Worker
Function } from '../benchmarks-utils.mjs'
-import {
Worker
Functions } from '../benchmarks-types.mjs'
+import { execute
Task
Function } from '../benchmarks-utils.mjs'
+import {
Task
Functions } from '../benchmarks-types.mjs'
const debug = false
const debug = false
-
function workerFunction (data)
{
+
const taskFunction = data =>
{
data = data || {}
data = data || {}
- data.function = data.function ||
Worker
Functions.jsonIntegerSerialization
-
executeWorker
Function(data)
+ data.function = data.function ||
Task
Functions.jsonIntegerSerialization
+
const res = executeTask
Function(data)
debug === true && console.debug('This is the main thread ' + isMaster)
debug === true && console.debug('This is the main thread ' + isMaster)
- return
{ ok: 1 }
+ return
res
}
}
-export default new ClusterWorker(
worker
Function)
+export default new ClusterWorker(
task
Function)