repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: cleanup object destructuration in examples
[poolifier.git]
/
benchmarks
/
internal
/
thread-worker.mjs
diff --git
a/benchmarks/internal/thread-worker.mjs
b/benchmarks/internal/thread-worker.mjs
index c1cd01414830aa9eaaa88bd2d7a0a3d0a4854ab4..855ba62225e50513a1375eb84806a4c077cf61e2 100644
(file)
--- a/
benchmarks/internal/thread-worker.mjs
+++ b/
benchmarks/internal/thread-worker.mjs
@@
-1,16
+1,16
@@
import { isMainThread } from 'worker_threads'
import { ThreadWorker } from '../../lib/index.mjs'
import { isMainThread } from 'worker_threads'
import { ThreadWorker } 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 ' + isMainThread)
debug === true && console.debug('This is the main thread ' + isMainThread)
- return
{ ok: 1 }
+ return
res
}
}
-export default new ThreadWorker(
worker
Function)
+export default new ThreadWorker(
task
Function)