diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-12-19 18:07:22 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-19 13:37:22 +0100 |
commit | 55fac9f5ead6d30996400e8597c969b675c5a22b (patch) | |
tree | f7646976d8e96cc3ca9e158f6a99828c648453e0 /cli/args/mod.rs | |
parent | aefa205f63d6e4d0d56b9fd45b3d25e03509b9fb (diff) |
fix(node): child_process IPC on Windows (#21597)
This PR implements the child_process IPC pipe between parent and child.
The implementation uses Windows named pipes created by parent and passes
the inheritable file handle to the child.
I've also replace parts of the initial implementation which passed the
raw parent fd to JS with resource ids instead. This way no file handle
is exposed to the JS land (both parent and child).
`IpcJsonStreamResource` can stream upto 800MB/s of JSON data on Win 11
AMD Ryzen 7 16GB (without `memchr` vectorization)
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 187d3d604..0c1bd6e0a 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -917,12 +917,12 @@ impl CliOptions { .map(Some) } - pub fn node_ipc_fd(&self) -> Option<i32> { + pub fn node_ipc_fd(&self) -> Option<i64> { let maybe_node_channel_fd = std::env::var("DENO_CHANNEL_FD").ok(); if let Some(node_channel_fd) = maybe_node_channel_fd { // Remove so that child processes don't inherit this environment variable. std::env::remove_var("DENO_CHANNEL_FD"); - node_channel_fd.parse::<i32>().ok() + node_channel_fd.parse::<i64>().ok() } else { None } |