diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-12-13 08:07:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 08:07:26 -0700 |
commit | 76a6ea57753be420398d3eba8f313a6c98eab8c3 (patch) | |
tree | 66c95d582b711aa4f4234943f5526b98c8176210 /runtime/worker.rs | |
parent | 461ef6bdd80347caa12934c2c16337bc8d40d9a4 (diff) |
refactor(cli): update to new deno_core promise/call methods (#21519)
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r-- | runtime/worker.rs | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs index 0bfb9305c..94b0d9606 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -3,8 +3,6 @@ use std::rc::Rc; use std::sync::atomic::AtomicI32; use std::sync::atomic::Ordering::Relaxed; use std::sync::Arc; -use std::task::Context; -use std::task::Poll; use std::time::Duration; use std::time::Instant; @@ -561,10 +559,9 @@ impl MainWorker { ) -> Result<(), AnyError> { match tokio::time::timeout( duration, - self.js_runtime.run_event_loop2(PollEventLoopOptions { - wait_for_inspector: false, - pump_v8_message_loop: true, - }), + self + .js_runtime + .run_event_loop(PollEventLoopOptions::default()), ) .await { @@ -613,27 +610,13 @@ impl MainWorker { self.js_runtime.inspector().borrow().create_local_session() } - pub fn poll_event_loop( - &mut self, - cx: &mut Context, - wait_for_inspector: bool, - ) -> Poll<Result<(), AnyError>> { - self.js_runtime.poll_event_loop2( - cx, - deno_core::PollEventLoopOptions { - wait_for_inspector, - ..Default::default() - }, - ) - } - pub async fn run_event_loop( &mut self, wait_for_inspector: bool, ) -> Result<(), AnyError> { self .js_runtime - .run_event_loop2(deno_core::PollEventLoopOptions { + .run_event_loop(deno_core::PollEventLoopOptions { wait_for_inspector, ..Default::default() }) |