Expand description
§dev-async
Async-specific validation for Rust. Deadlocks, task leaks, hung
futures, graceful shutdown. Part of the dev-* verification suite.
Async Rust fails in subtle ways that synchronous unit tests can’t
catch: a future that never completes, a task that gets dropped
without cleanup, a shutdown that hangs because one worker is stuck
in a blocking call. dev-async provides primitives for catching
these issues programmatically.
§Quick example
Run a future with a hard timeout. If it doesn’t finish in time, you
get a Fail verdict, not a hang.
use dev_async::run_with_timeout;
use std::time::Duration;
let _check = run_with_timeout(
"user_login",
Duration::from_secs(2),
async { do_login().await }
).await;§Modules
Modules§
- blocking
block-detect - Heuristic blocking-call detection inside async tasks.
- deadlock
- Timeout-based deadlock detection helpers.
- shutdown
- Graceful-shutdown verification.
- tasks
- Task tracking for leak detection.
Structs§
- Blocking
Async Producer - Adapter that wraps an
async fnreturning aReportand implementsdev_report::Producerby callingtokio::runtime::Handle::current().block_on(...).
Traits§
- Async
Check - A trait for any async harness that produces a verdict via a future.
- Async
Producer - An async producer that builds a
Report.
Functions§
- join_
all_ with_ timeout - Verify that all spawned tasks finish within the given timeout.
- run_
with_ timeout - Run a future with a hard timeout. Produces a
CheckResulttaggedasync.