From e5beb800c94099852964d482a32a13f5c29ec147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 26 May 2021 21:07:12 +0200 Subject: refactor: move JsRuntimeInspector to deno_core (#10763) This commit moves implementation of "JsRuntimeInspector" to "deno_core" crate. To achieve that following changes were made: * "Worker" and "WebWorker" no longer own instance of "JsRuntimeInspector", instead it is now owned by "deno_core::JsRuntime". * Consequently polling of inspector is no longer done in "Worker"/"WebWorker", instead it's done in "deno_core::JsRuntime::poll_event_loop". * "deno_core::JsRuntime::poll_event_loop" and "deno_core::JsRuntime::run_event_loop", now accept "wait_for_inspector" boolean that tells if event loop should still be "pending" if there are active inspector sessions - this change fixes the problem that inspector disconnects from the frontend and process exits once the code has stopped executing. --- runtime/examples/hello_runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/examples/hello_runtime.rs') diff --git a/runtime/examples/hello_runtime.rs b/runtime/examples/hello_runtime.rs index e8abaffb8..34b249e0b 100644 --- a/runtime/examples/hello_runtime.rs +++ b/runtime/examples/hello_runtime.rs @@ -55,6 +55,6 @@ async fn main() -> Result<(), AnyError> { MainWorker::from_options(main_module.clone(), permissions, &options); worker.bootstrap(&options); worker.execute_module(&main_module).await?; - worker.run_event_loop().await?; + worker.run_event_loop(false).await?; Ok(()) } -- cgit v1.2.3