-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: document that 'ipc'
is required with fork stdio option
#8290
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -290,6 +290,17 @@ parent process using the file descriptor (fd) identified using the | |
environment variable `NODE_CHANNEL_FD` on the child process. The input and | ||
output on this fd is expected to be line delimited JSON objects. | ||
|
||
When specifying the [`stdio`][] option, the value *must* be a JSON Array | ||
containing at least one item with value `'ipc'` or a `TypeError` will be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't it be exactly one 'ipc'? I added test in ae4ce9f that fails if you try to setup multiple IPC channels. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome, no |
||
thrown. For instance: | ||
|
||
```js | ||
const child_process = require('child_process'); | ||
child_process.fork('my_script.js', [], { | ||
stdio: [0, 1, 2, 'ipc'] | ||
}); | ||
``` | ||
|
||
*Note: Unlike the fork(2) POSIX system call, `child_process.fork()` does | ||
not clone the current process.* | ||
|
||
|
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.
JSON Array -> array