rust-async-patterns
Installation
Summary
Production patterns for async Rust with Tokio, channels, error handling, and concurrent task management.
- Covers seven core patterns: concurrent task execution with
JoinSetandselect!, multi-producer channels (mpsc, broadcast, oneshot, watch), custom error types withanyhowandthiserror, graceful shutdown viaCancellationToken, async traits withasync_trait, streams and async iteration, and resource pooling withRwLockandSemaphore - Includes practical examples for racing futures, limiting concurrency, timeout handling, and task cancellation across shutdown scenarios
- Provides debugging guidance using
tokio-console,tracinginstrumentation, and common pitfalls like blocking in async contexts or holding locks across awaits - Best practices section covers when to use channels over shared state, proper error propagation, and spawn limits to prevent resource exhaustion
SKILL.md
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