GeezerVison is showing github.com — doc: fix worker example to receive message · nodejs/node@b510cdc
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/worker_threads.md +2-2Lines changed: 2 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -377,7 +377,7 @@ added: v10.5.0 |
377 | 377 | * `transferList` {Object[]} |
378 | 378 |
|
379 | 379 | Send a message to the worker that will be received via |
380 | | -[`require('worker_threads').on('message')`][]. |
| 380 | +[`require('worker_threads').parentPort.on('message')`][]. |
381 | 381 | See [`port.postMessage()`][] for more details. |
382 | 382 |
|
383 | 383 | ### worker.ref() |
@@ -480,7 +480,7 @@ active handle in the event system. If the worker is already `unref()`ed calling |
480 | 480 | [`process.stdout`]: process.html#process_process_stdout |
481 | 481 | [`process.title`]: process.html#process_process_title |
482 | 482 | [`require('worker_threads').workerData`]: #worker_threads_worker_workerdata |
483 | | -[`require('worker_threads').on('message')`]: #worker_threads_event_message_1 |
| 483 | +[`require('worker_threads').parentPort.on('message')`]: #worker_threads_event_message |
484 | 484 | [`require('worker_threads').postMessage()`]: #worker_threads_worker_postmessage_value_transferlist |
485 | 485 | [`require('worker_threads').isMainThread`]: #worker_threads_worker_ismainthread |
486 | 486 | [`require('worker_threads').parentPort`]: #worker_threads_worker_parentport |
|