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 /ext/node/polyfills/internal/child_process.ts | |
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 'ext/node/polyfills/internal/child_process.ts')
-rw-r--r-- | ext/node/polyfills/internal/child_process.ts | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/node/polyfills/internal/child_process.ts b/ext/node/polyfills/internal/child_process.ts index b9bf13396..0e93e22d3 100644 --- a/ext/node/polyfills/internal/child_process.ts +++ b/ext/node/polyfills/internal/child_process.ts @@ -45,7 +45,6 @@ import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs"; import process from "node:process"; const core = globalThis.__bootstrap.core; -const ops = core.ops; export function mapValues<T, O>( record: Readonly<Record<string, T>>, @@ -1069,9 +1068,7 @@ function toDenoArgs(args: string[]): string[] { return denoArgs; } -export function setupChannel(target, channel) { - const ipc = ops.op_node_ipc_pipe(channel); - +export function setupChannel(target, ipc) { async function readLoop() { try { while (true) { |