summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-12-13 15:44:16 +0530
committerGitHub <noreply@github.com>2023-12-13 11:14:16 +0100
commit5a91a065b882215dde209baf626247e54c21a392 (patch)
tree192cb8b3b0a4037453b5fd5b2a60e4d52d4543a8 /cli/worker.rs
parentbbf8f69cb979be0f36c38ae52b1588e648b3252e (diff)
fix: implement child_process IPC (#21490)
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.
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index ce9c05701..22e534e1d 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -124,6 +124,7 @@ struct SharedWorkerState {
maybe_inspector_server: Option<Arc<InspectorServer>>,
maybe_lockfile: Option<Arc<Mutex<Lockfile>>>,
feature_checker: Arc<FeatureChecker>,
+ node_ipc: Option<i32>,
}
impl SharedWorkerState {
@@ -415,6 +416,7 @@ impl CliMainWorkerFactory {
maybe_lockfile: Option<Arc<Mutex<Lockfile>>>,
feature_checker: Arc<FeatureChecker>,
options: CliMainWorkerOptions,
+ node_ipc: Option<i32>,
) -> Self {
Self {
shared: Arc::new(SharedWorkerState {
@@ -435,6 +437,7 @@ impl CliMainWorkerFactory {
maybe_inspector_server,
maybe_lockfile,
feature_checker,
+ node_ipc,
}),
}
}
@@ -596,6 +599,7 @@ impl CliMainWorkerFactory {
.options
.maybe_binary_npm_command_name
.clone(),
+ node_ipc_fd: shared.node_ipc,
},
extensions: custom_extensions,
startup_snapshot: crate::js::deno_isolate_init(),
@@ -793,6 +797,7 @@ fn create_web_worker_callback(
.options
.maybe_binary_npm_command_name
.clone(),
+ node_ipc_fd: None,
},
extensions: vec![],
startup_snapshot: crate::js::deno_isolate_init(),