Skip to content
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: optimize child process doc #52154

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1222,8 +1222,8 @@ added: v0.5.9
-->

* `message` {Object} A parsed JSON object or primitive value.
* `sendHandle` {Handle} A [`net.Socket`][] or [`net.Server`][] object, or
undefined.
* `sendHandle` {Handle|undefined} `undefined` or a [`net.Socket`][],
[`net.Server`][], or [`dgram.Socket`][] object.

The `'message'` event is triggered when a child process uses
[`process.send()`][] to send messages.
Expand Down Expand Up @@ -1481,7 +1481,8 @@ changes:
-->

* `message` {Object}
* `sendHandle` {Handle}
* `sendHandle` {Handle|undefined} `undefined`, or a [`net.Socket`][],
[`net.Server`][], or [`dgram.Socket`][] object.
* `options` {Object} The `options` argument, if present, is an object used to
parameterize the sending of certain types of handles. `options` supports
the following properties:
Expand Down Expand Up @@ -1539,7 +1540,8 @@ The optional `sendHandle` argument that may be passed to `subprocess.send()` is
for passing a TCP server or socket object to the child process. The child will
receive the object as the second argument passed to the callback function
registered on the [`'message'`][] event. Any data that is received
and buffered in the socket will not be sent to the child.
and buffered in the socket will not be sent to the child. Sending IPC sockets is
not supported on Windows.

The optional `callback` is a function that is invoked after the message is
sent but before the child may have received it. The function is called with a
Expand Down Expand Up @@ -1872,6 +1874,7 @@ or [`child_process.fork()`][].
[`child_process.fork()`]: #child_processforkmodulepath-args-options
[`child_process.spawn()`]: #child_processspawncommand-args-options
[`child_process.spawnSync()`]: #child_processspawnsynccommand-args-options
[`dgram.Socket`]: dgram.md#class-dgramsocket
[`maxBuffer` and Unicode]: #maxbuffer-and-unicode
[`net.Server`]: net.md#class-netserver
[`net.Socket`]: net.md#class-netsocket
Expand Down