
Description
rust-async-patterns is an agent skill from the wshobson/agents collection for writing production async Rust code with the Tokio runtime. It covers the async execution model that Rust uses, along with tasks, channels, streams and error handling. The patterns include running concurrent tasks with JoinSet and select!, which let a program wait on several futures and react to whichever finishes first; multi-producer channels of the kinds Tokio provides, mpsc, broadcast, oneshot and watch, each suited to a different way of passing messages between tasks; and custom error types built with the anyhow and thiserror crates, so errors in async code stay informative. The skill also covers graceful shutdown, which lets running tasks finish or stop cleanly when a service is asked to exit. It applies when building async Rust applications, implementing concurrent network services, using Tokio for async I/O, handling async errors properly, debugging async code problems, and optimizing async performance. Async bugs in Rust, such as tasks that never finish or cancel at the wrong point, are easy to introduce, so the skill's guidance is most useful when applied with tests that exercise shutdown and failure paths. The skill is installed with the skills CLI from the wshobson/agents repository. Its skills.sh page showed about 19.9K installs and passing results from three security audits at the time of the scan.…
Highlights
- Tokio-based async patterns for Rust
- Concurrent tasks with JoinSet and select!
- mpsc, broadcast, oneshot and watch channels
- Error types with anyhow and thiserror
- Graceful shutdown guidance
- Installs with the skills CLI
Ratings & Reviews
No ratings yet
Be the first to rate rust-async-patterns.
People also visit
rust-async-patterns FAQ
Which runtime does it target?
Tokio, the async runtime most Rust network services use.
Which channel types are covered?
mpsc, broadcast, oneshot and watch, each for a different way of passing messages between tasks.
How are errors handled?
With custom error types built using anyhow and thiserror.
Does it cover shutdown?
Yes. Graceful shutdown is among the patterns.
How do I install it?
Run npx skills add https://github.com/wshobson/agents --skill rust-async-patterns.
What security audits does it have?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass.
What are the best rust-async-patterns alternatives?
Popular alternatives to rust-async-patterns include async-python-patterns, rust-patterns and go-concurrency-patterns. See all rust-async-patterns alternatives









