Unverified Commit 42be4c3b authored by Sakthipriyan Vairamani (thefourtheye)'s avatar Sakthipriyan Vairamani (thefourtheye) Committed by Ruben Bridgewater
Browse files

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: https://github.com/nodejs/node/pull/21486


Reviewed-By: default avatarTiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: default avatarVse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
parent 39902e28
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment