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

Function subscribe_multiple_durations_zipped

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

Source from the content-addressed store, hash-verified

351 // pollables because both are awaiting, and one with just the later pollable.
352 #[test]
353 fn subscribe_multiple_durations_zipped() {
354 crate::runtime::block_on(async {
355 let reactor = Reactor::current();
356 let start = wasip2::clocks::monotonic_clock::now();
357 let soon = wasip2::clocks::monotonic_clock::subscribe_duration(10_000_000);
358 let later = wasip2::clocks::monotonic_clock::subscribe_duration(40_000_000);
359 let soon = reactor.schedule(soon);
360 let later = reactor.schedule(later);
361
362 futures_lite::future::zip(
363 async move {
364 soon.wait_for().await;
365 println!(
366 "*** subscribe_duration(soon) ready ({})",
367 wasip2::clocks::monotonic_clock::now() - start
368 );
369 },
370 async move {
371 later.wait_for().await;
372 println!(
373 "*** subscribe_duration(later) ready ({})",
374 wasip2::clocks::monotonic_clock::now() - start
375 );
376 },
377 )
378 .await;
379 })
380 }
381
382 #[test]
383 fn progresses_wasi_independent_futures() {

Callers

nothing calls this directly

Calls 3

block_onFunction · 0.85
scheduleMethod · 0.80
wait_forMethod · 0.80

Tested by

no test coverage detected