summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-11-22 03:45:34 +0100
committerGitHub <noreply@github.com>2023-11-22 03:45:34 +0100
commita8c24d2a8b794eec343a518614cbca0a87b9e2fb (patch)
tree383562e2165e247eb15728f27412764c78c7821d /runtime/worker.rs
parentcc5d6df50b3e5a755bdec884ec78dc005e97b5a2 (diff)
fix: 'Promise was collected' error in REPL/jupyter (#21272)
Fixes #20528
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs20
1 files changed, 0 insertions, 20 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index e83c8a720..c60e189f7 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -1,6 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-use std::pin::Pin;
use std::rc::Rc;
use std::sync::atomic::AtomicI32;
use std::sync::atomic::Ordering::Relaxed;
@@ -15,7 +14,6 @@ use deno_cache::SqliteBackedCache;
use deno_core::ascii_str;
use deno_core::error::AnyError;
use deno_core::error::JsError;
-use deno_core::futures::Future;
use deno_core::merge_op_metrics;
use deno_core::v8;
use deno_core::CompiledWasmModuleStore;
@@ -615,24 +613,6 @@ impl MainWorker {
self.js_runtime.run_event_loop(wait_for_inspector).await
}
- /// A utility function that runs provided future concurrently with the event loop.
- ///
- /// Useful when using a local inspector session.
- pub async fn with_event_loop<'a, T>(
- &mut self,
- mut fut: Pin<Box<dyn Future<Output = T> + 'a>>,
- ) -> T {
- loop {
- tokio::select! {
- biased;
- result = &mut fut => {
- return result;
- }
- _ = self.run_event_loop(false) => {}
- };
- }
- }
-
/// Return exit code set by the executed code (either in main worker
/// or one of child web workers).
pub fn exit_code(&self) -> i32 {