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 JoinSet and select!, multi-producer channels (mpsc, broadcast, oneshot, watch), custom error types with anyhow and thiserror, graceful shutdown via CancellationToken, async traits with async_trait, streams and async iteration, and resource pooling with RwLock and Semaphore
  • Includes practical examples for racing futures, limiting concurrency, timeout handling, and task cancellation across shutdown scenarios
  • Provides debugging guidance using tokio-console, tracing instrumentation, 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

Core Concepts

1. Async Execution Model

Future (lazy) → poll() → Ready(value) | Pending
Related skills

More from wshobson/agents

Installs
12.1K
Repository
wshobson/agents
GitHub Stars
35.2K
First Seen
Jan 20, 2026