repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update README.MD
[poolifier.git]
/
yourWorker.js
diff --git
a/yourWorker.js
b/yourWorker.js
index ffb72c2969a0e6845801efa003b3e8c2dfc4fbce..c3a7b0c4a9d606abee2c8b9780e0fa6df0af59e4 100644
(file)
--- a/
yourWorker.js
+++ b/
yourWorker.js
@@
-1,13
+1,17
@@
'use strict'
'use strict'
-const ThreadWorker = require('./worker')
-const { isMainThread } = require('worker_threads')
+const { ThreadWorker } = require('./lib/workers')
class MyWorker extends ThreadWorker {
constructor () {
super((data) => {
class MyWorker extends ThreadWorker {
constructor () {
super((data) => {
+ for (let i = 0; i <= 10000; i++) {
+ const o = {
+ a: i
+ }
+ JSON.stringify(o)
+ }
// console.log('This is the main thread ' + isMainThread)
// console.log('This is the main thread ' + isMainThread)
- // this.parent.postMessage(JSON.stringify(data))
- return JSON.stringify(data)
+ return data
})
}
}
})
}
}