summaryrefslogtreecommitdiff
path: root/runtime/ops/worker_host.rs
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-03-13 22:52:25 +0530
committerGitHub <noreply@github.com>2024-03-13 17:22:25 +0000
commit0fd8f549e2194223eca2d4b17f4e96cd5a0f5fd5 (patch)
tree76181b2a5f2991134f7343cfc6d4b8b755dbc333 /runtime/ops/worker_host.rs
parentb3ca3b2f25931afb350027bde87dc3d4f9a741b0 (diff)
fix(ext/node): allow automatic worker_thread termination (#22647)
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'runtime/ops/worker_host.rs')
-rw-r--r--runtime/ops/worker_host.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs
index 1d056d459..3cfad5abb 100644
--- a/runtime/ops/worker_host.rs
+++ b/runtime/ops/worker_host.rs
@@ -35,6 +35,7 @@ pub struct CreateWebWorkerArgs {
pub permissions: PermissionsContainer,
pub main_module: ModuleSpecifier,
pub worker_type: WebWorkerType,
+ pub close_on_idle: bool,
pub maybe_worker_metadata: Option<JsMessageData>,
}
@@ -114,6 +115,7 @@ pub struct CreateWorkerArgs {
source_code: String,
specifier: String,
worker_type: WebWorkerType,
+ close_on_idle: bool,
}
/// Create worker as the host
@@ -191,6 +193,7 @@ fn op_create_worker(
permissions: worker_permissions,
main_module: module_specifier.clone(),
worker_type,
+ close_on_idle: args.close_on_idle,
maybe_worker_metadata,
});