-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: improve worker_threads documentation #26110
Conversation
This adds a few examples and clarifications.
@@ -156,6 +209,9 @@ Disables further sending of messages on either side of the connection. | |||
This method can be called when no further communication will happen over this | |||
`MessagePort`. | |||
|
|||
The [`'close'` event][] will be emitted on both `MessagePort` instances that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be I'm over-reacting to passive voice, but perhaps this?:
Both `MessagePort` instances that are part of the channel will emit a [`'close'` event][].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to admit that active voice sounds a bit weird to me when referring to events :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left two completely-optional totally-ignorable comment/suggestions, but LGTM as-is.
@@ -91,6 +120,16 @@ added: v10.5.0 | |||
An arbitrary JavaScript value that contains a clone of the data passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to include more of a description of what "clone" here means in general. I know there are a few bits and pieces of an explanation through the doc, but coalescing those into a single section with some information on what types of values cannot be cloned, would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `worker_threads` module enables the use of threads with message channels | ||
between them. To access it: | ||
The `worker_threads` module enables the use of threads that execute JS code | ||
in parallel. To access it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something more like "that allow parallel execution contexts for JS code"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fishrock123 I’m not sure … “execution context” sounds like a very generic thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With nits)
Landed in 70a500f |
This adds a few examples and clarifications. PR-URL: #26110 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
This adds a few examples and clarifications. PR-URL: #26110 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
This adds a few examples and clarifications. PR-URL: #26110 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
This adds a few examples and clarifications.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes