MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / subscribe_multiple_durations

Function subscribe_multiple_durations

src/runtime/reactor.rs:338–348  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

336 // ready, but not what the waker requests.
337 #[test]
338 fn subscribe_multiple_durations() {
339 crate::runtime::block_on(async {
340 let reactor = Reactor::current();
341 let now = wasip2::clocks::monotonic_clock::subscribe_duration(0);
342 let soon = wasip2::clocks::monotonic_clock::subscribe_duration(10_000_000);
343 let now = reactor.schedule(now);
344 let soon = reactor.schedule(soon);
345 soon.wait_for().await;
346 drop(now)
347 })
348 }
349
350 // Using WASMTIME_LOG, observe that this test results in two calls to poll(), one with both
351 // pollables because both are awaiting, and one with just the later pollable.

Callers

nothing calls this directly

Calls 3

block_onFunction · 0.85
scheduleMethod · 0.80
wait_forMethod · 0.80

Tested by

no test coverage detected