mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
worker: rename to worker_threads
PR-URL: https://github.com/nodejs/node/pull/20876 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
1 parent
6caa354377
commit
03fbc9e749
33 files changed
+71
-66
No files matched your search
@@ -3,14 +3,14 @@
|
||||
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const { Worker } = require('worker');
|
||||
const { Worker } = require('worker_threads');
|
||||
|
||||
{
|
||||
const sharedArrayBuffer = new SharedArrayBuffer(12);
|
||||
const local = Buffer.from(sharedArrayBuffer);
|
||||
|
||||
const w = new Worker(`
|
||||
const { parentPort } = require('worker');
|
||||
const { parentPort } = require('worker_threads');
|
||||
parentPort.on('message', ({ sharedArrayBuffer }) => {
|
||||
const local = Buffer.from(sharedArrayBuffer);
|
||||
local.write('world!', 6);
|
||||
|
||||
Reference in new issue
Block a user