summaryrefslogtreecommitdiff
path: root/doc/api/worker_threads.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/worker_threads.md')
-rw-r--r--doc/api/worker_threads.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md
index 9578403c5c..d20fd0fce5 100644
--- a/doc/api/worker_threads.md
+++ b/doc/api/worker_threads.md
@@ -296,7 +296,7 @@ if (isMainThread) {
console.log('received:', value);
});
} else {
- require('worker_threads').once('workerMessage', (value) => {
+ require('worker_threads').once('message', (value) => {
assert(value.hereIsYourPort instanceof MessagePort);
value.hereIsYourPort.postMessage('the worker is sending this');
value.hereIsYourPort.close();
@@ -377,7 +377,7 @@ added: v10.5.0
* `transferList` {Object[]}
Send a message to the worker that will be received via
-[`require('worker_threads').on('workerMessage')`][].
+[`require('worker_threads').on('message')`][].
See [`port.postMessage()`][] for more details.
### worker.ref()
@@ -467,7 +467,7 @@ active handle in the event system. If the worker is already `unref()`ed calling
[`port.postMessage()`]: #worker_threads_port_postmessage_value_transferlist
[`Worker`]: #worker_threads_class_worker
[`worker.terminate()`]: #worker_threads_worker_terminate_callback
-[`worker.postMessage()`]: #worker_threads_worker_postmessage_value_transferlist_1
+[`worker.postMessage()`]: #worker_threads_worker_postmessage_value_transferlist
[`worker.on('message')`]: #worker_threads_event_message_1
[`worker.threadId`]: #worker_threads_worker_threadid_1
[`port.on('message')`]: #worker_threads_event_message
@@ -480,7 +480,7 @@ active handle in the event system. If the worker is already `unref()`ed calling
[`process.stdout`]: process.html#process_process_stdout
[`process.title`]: process.html#process_process_title
[`require('worker_threads').workerData`]: #worker_threads_worker_workerdata
-[`require('worker_threads').on('workerMessage')`]: #worker_threads_event_workermessage
+[`require('worker_threads').on('message')`]: #worker_threads_event_message_1
[`require('worker_threads').postMessage()`]: #worker_threads_worker_postmessage_value_transferlist
[`require('worker_threads').isMainThread`]: #worker_threads_worker_ismainthread
[`require('worker_threads').parentPort`]: #worker_threads_worker_parentport