sync mode on
This commit is contained in:
1 parent
1818932244
commit
1174b328e5
415 files changed
+44294
-1182
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
const { parentPort } = require('worker_threads')
|
||||
const { Writable } = require('stream')
|
||||
|
||||
function run () {
|
||||
parentPort.once('message', function ({ text, takeThisPortPlease }) {
|
||||
takeThisPortPlease.postMessage(`received: ${text}`)
|
||||
})
|
||||
return new Writable({
|
||||
autoDestroy: true,
|
||||
write (chunk, enc, cb) {
|
||||
cb()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = run
|
||||
Reference in new issue
Block a user