-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix: implement child_process IPC #21490
Conversation
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.
LGTM, please address these comments in a follow up PR.
@@ -69,7 +69,6 @@ import { buildAllowedFlags } from "ext:deno_node/internal/process/per_thread.mjs | |||
|
|||
const notImplementedEvents = [ | |||
"disconnect", |
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.
We should implement this event as well, but let's do that in a follow up PR.
@@ -203,6 +205,12 @@ class ChildProcess { | |||
#waitPromise; | |||
#waitComplete = false; | |||
|
|||
#pipeFd; | |||
// internal, used by ext/node | |||
get _pipeFd() { |
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.
This is not great. Can you think of a way how we could not expose it to user code? Let's address that in a follow up.
@@ -265,7 +265,91 @@ fn create_command( | |||
value => value.as_stdio(), | |||
}); | |||
|
|||
Ok(command) | |||
#[cfg(unix)] | |||
// TODO(bartlomieju): |
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.
Please address that comment :)
This PR implements the Node child_process IPC functionality in Deno on Unix systems.
For
fd > 2
a duplex unix pipe is set up between the parent and child processes. Currently implements data passing via the channel in the JSON serialization format.