repositories
/
poolifier.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
README.md: Small refinements
[poolifier.git]
/
benchmarks
/
cluster
/
worker.js
1
'use strict'
2
const
{
ClusterWorker
} =
require
(
'../../lib/index'
)
3
4
function
yourFunction
(
data
) {
5
for
(
let
i
=
0
;
i
<=
1000
;
i
++) {
6
const
o
= {
7
a
:
i
8
}
9
JSON
.
stringify
(
o
)
10
}
11
// console.log('This is the main thread ' + isMainThread)
12
return
{
ok
:
1
}
13
}
14
15
module
.
exports
=
new
ClusterWorker
(
yourFunction
)