cab
cab
DDeno
Created by cab on 5/25/2024 in #help
driving async ops in deno_core
What's the correct way to run a single tick of the event loop in deno_core? I'm using poll_event_loop, but the result is always pending (i.e. the timers created with core.queueUserTimer are never resolving). Is there something else I need to poll? If I use tokio.block_on(run_event_loop) it works correctly, but I only want to run a single tick. My code currently looks like this:
let mut cx = std::task::Context::from_waker(futures::task::noop_waker_ref());
let res = runtime
.js
.poll_event_loop(&mut cx, PollEventLoopOptions::default());
let mut cx = std::task::Context::from_waker(futures::task::noop_waker_ref());
let res = runtime
.js
.poll_event_loop(&mut cx, PollEventLoopOptions::default());
Thanks!
3 replies