Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign updoc: fix worker example to receive message #21486
Conversation
thefourtheye
added
doc
worker
labels
Jun 23, 2018
thefourtheye
requested a review
from
addaleax
Jun 23, 2018
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
the
doc
label
Jun 23, 2018
TimothyGu
approved these changes
Jun 23, 2018
doc/api/worker_threads.md
Outdated
| @@ -375,7 +376,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').parentPort.on('message')`][]. | |||
This comment has been minimized.
This comment has been minimized.
TimothyGu
Jun 23, 2018
Member
I think in this case the norm is to link worker_threads.parentPort and 'message' separately, to something like
received via [`worker_threads.parentPort`][]'s [`'message'`][`port.on('message')`] event.
vsemozhetbyt
approved these changes
Jun 23, 2018
jasnell
approved these changes
Jun 24, 2018
This comment has been minimized.
This comment has been minimized.
vssenko
commented
Jun 29, 2018
|
Wow, luckly i found this issue, helped a lot. But documentation is still invalid. |
TimothyGu
referenced this pull request
Jul 9, 2018
Closed
tools: add no-duplicate-requires rule #21712
This comment has been minimized.
This comment has been minimized.
|
@thefourtheye Can you rebase this? |
vsemozhetbyt
referenced this pull request
Jul 10, 2018
Closed
some code example outdated in the doc for worker_threads #21714
This comment has been minimized.
This comment has been minimized.
|
ping @thefourtheye |
thefourtheye
force-pushed the
thefourtheye:fix-worker-threads-doc
branch
from
f80beff
to
9bc522d
Jul 17, 2018
thefourtheye
force-pushed the
thefourtheye:fix-worker-threads-doc
branch
from
9bc522d
to
d1b0121
Jul 17, 2018
This comment has been minimized.
This comment has been minimized.
cjihrig
approved these changes
Jul 17, 2018
addaleax
approved these changes
Jul 18, 2018
addaleax
added
the
author ready
label
Jul 18, 2018
This comment has been minimized.
This comment has been minimized.
BridgeAR
approved these changes
Jul 18, 2018
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Jul 18, 2018
This comment has been minimized.
This comment has been minimized.
|
Landed in 42be4c3 |
BridgeAR
closed this
Jul 18, 2018
thefourtheye
deleted the
thefourtheye:fix-worker-threads-doc
branch
Jul 18, 2018
targos
removed
the
author ready
label
Jul 19, 2018
targos
added a commit
that referenced
this pull request
Jul 19, 2018
beevelop
referenced this pull request
Aug 1, 2018
Closed
2018-08-01 Version 10.8.0 (Current) @targos #212
This was referenced Aug 1, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
thefourtheye commentedJun 23, 2018
•
edited
require('worker_threads')is not an instance ofEventEmitter. Sooncemethod would not be in it. The correct way to receive the messagewould be to attach a listener to the
messageevent on theparentPort.Also, there is no built-in event called
workerMessage. This patchfixes it by referencing
messageevent.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes