
Rust Async Patterns
A comprehensive guide to async Rust that goes beyond the basics. Covers production patterns like JoinSet for concurrent tasks, proper channel selection between mpsc/broadcast/oneshot, graceful shutdown with CancellationToken, and async trait implementations. The error handling section shows both anyhow and thiserror approaches with concrete examples. What I like here is the emphasis on real patterns you actually need in production, not just hello world async examples. The concurrency limiting with buffer_unordered and timeout wrappers address common pain points. Good reference when you're past the "add .await everywhere" stage and need to build robust async systems.
- install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
- 13
- skills.sh installs
- 21.9K
- GitHub stars
- 42.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add wshobson/agents --skill rust-async-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Rust Async Patterns
Production patterns for async Rust programming with Tokio runtime, including tasks, channels, streams, and error handling.
When to Use This Skill
- Building async Rust applications
- Implementing concurrent network services
- Using Tokio for async I/O
- Handling async errors properly
- Debugging async code issues
- Optimizing async performance
Core Concepts
1. Async Execution Model
Future (lazy) → poll() → Ready(value) | Pending
↑ ↓
Waker ← Runtime schedules
2. Key Abstractions
| Concept | Purpose |
|---|---|
Future | Lazy computation that may complete later |
async fn | Function returning impl Future |
await | Suspend until future completes |
Task | Spawned future running concurrently |
Runtime | Executor that polls futures |
Quick Start
# Cargo.toml
[dependencies]
tokio = { version = "1", features = ["full"] }
futures = "0.3"
async-trait = "0.1"
anyhow = "1.0"
tracing = "0.1"
tracing-subscriber = "0.3"
Sponsors
Details
- Repository
- github.com/wshobson/agents
- Categories
- Debugging, Rust
More from wshobson/agents
All 174- Threat Mitigation Mapping21.2K
- Javascript Testing Patterns21.1K
- Auth Implementation Patterns20.9K
- Sql Optimization Patterns20.4K
- Git Advanced Workflows19.9K
- Dotnet Backend Patterns19.6K
- Async Python Patterns18.8K
- Attack Tree Construction18.8K
- Godot Gdscript Patterns18.3K
- Github Actions Templates18.1K
- Database Migration18K
- Data Storytelling17.6K
- Backtesting Frameworks17.5K
- Kpi Dashboard Design17.2K
- Python Code Style17.1K
- Openapi Spec Generation17K
- Interaction Design17K
- Design System Patterns16.7K
- Terraform Module Library16.1K
- React Native Design16.1K
- React State Management15.9K
- Solidity Security15.8K
- Uv Package Manager15.7K
- React Native Architecture15.6K