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

Function subscribe_some_duration

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

Source from the content-addressed store, hash-verified

323 // Using WASMTIME_LOG, observe that this test calls poll() until the timer is ready.
324 #[test]
325 fn subscribe_some_duration() {
326 crate::runtime::block_on(async {
327 let reactor = Reactor::current();
328 let pollable = wasip2::clocks::monotonic_clock::subscribe_duration(10_000_000);
329 let sched = reactor.schedule(pollable);
330 sched.wait_for().await;
331 })
332 }
333
334 // Using WASMTIME_LOG, observe that this test results in a single poll() on the second
335 // subscription, rather than spinning in poll() with first subscription, which is instantly

Callers

nothing calls this directly

Calls 3

block_onFunction · 0.85
scheduleMethod · 0.80
wait_forMethod · 0.80

Tested by

no test coverage detected