Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides advanced Rust async programming, covering runtime choice, async traits, task spawning, blocking calls, and JoinSet concurrency.
88% 96%+8 ptsof test cases passed
Passed 25 of 26 test cases with the skill, and 23 of 26 without it.
3 of 3 safety checks passed
27 agent runs
Use this skill when the user:
async-trait crate vs native async fn in trait (stabilized in Rust 1.75+)tokio::spawn, tokio::task::spawn_local, JoinSet, FuturesUnordered, or join! based on lifetime, ownership, and cancellation requirementsJoinSet or FuturesUnordered.await calls, accidental blocking on the async thread pool, or tasks leaking after cancellationFuture by hand, or use Pin<Box<dyn Future>> for dynamic dispatch of futurestokio::sync::mpsc, broadcast, oneshot, watch, or how to choose between themDo NOT use this skill when:
rust-ownership-patterns (note: lifetime issues in async closures are ownership topics, not async patterns)rust-performanceResult, ? operator, thiserror/anyhow crate selection, or error propagation strategy -- use rust-error-handlingstd::thread, Arc<Mutex<T>>) without any async involvementno_std) where standard async runtimes are unavailable -- specialized embedded async (embassy) is a separate concernBefore writing any code, determine which async problem category applies:
tokio::spawn or join! depending on whether tasks are independent or coordinated.tokio::task::spawn_blocking or a dedicated thread pool. Never run CPU work >~1ms directly on the async executor.JoinSet for ownership-clean collection, FuturesUnordered when you want stream-style polling.tokio::spawn at application startup with AbortHandle stored for clean shutdown.tokio_stream, async-stream crate, or manual Stream impl.LocalSet) -- futures that contain Rc<T> or aren't Send. Answer: tokio::task::LocalSet + spawn_local.Identify which category applies before touching runtime selection. Multiple categories can coexist in one application.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus popular skills in the same category.