Commit b510cdc
doc: fix worker example to receive message
`require('worker_threads')` is not an instance of `EventEmitter`. So
`on` method would not be in it. The correct way to receive the message
would be to attach a listener to the `message` event on the
`parentPort`.
PR-URL: #21486
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>1 parent 580071d commit b510cdcCopy full SHA for b510cdc
File tree
Expand file treeCollapse file tree
1 file changed
+2
-2
lines changedOpen diff view settings
Filter options
- doc/api
Expand file treeCollapse file tree
1 file changed
+2
-2
lines changedOpen diff view settings
Collapse file
+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 | 377 | |
378 | 378 | |
379 | 379 | |
380 | | - |
| 380 | + |
381 | 381 | |
382 | 382 | |
383 | 383 | |
| ||
480 | 480 | |
481 | 481 | |
482 | 482 | |
483 | | - |
| 483 | + |
484 | 484 | |
485 | 485 | |
486 | 486 | |
|
0 commit comments