tokio-concurrency

Implement Tokio concurrency patterns for fan-out/fan-in and pipeline processing.

8|2|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/geoffjay/claude-plugins --skill tokio-concurrency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tokio-concurrency
Source: https://github.com/geoffjay/claude-plugins/tree/main/plugins/rust-tokio-expert/skills/tokio-concurrency
Command: npx skills add https://github.com/geoffjay/claude-plugins --skill tokio-concurrency

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides advanced concurrency patterns for building scalable async applications with Tokio.

Core Features & Use Cases

  • Fan-Out/Fan-In Pattern: Distribute work across multiple workers and collect results.
  • Pipeline Processing: Chain async processing stages.
  • Rate Limiting: Control operation rate using token bucket or leaky bucket approaches.
  • Parallel Task Execution with Join: Execute multiple tasks in parallel and wait for all.
  • Coordinated Shutdown with CancellationToken: Manage hierarchical cancellation.

Quick Start

Use the tokio-concurrency skill to implement a fan-out/fan-in pipeline with a rate-limited stage.

Frequently Asked Questions about tokio-concurrency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I distribute work across multiple concurrent tasks in Tokio?

Fan-out/fan-in patterns distribute work across multiple Tokio workers and collect results. Spawn tasks that process items in parallel, then join or channel results back to coordinate completion and aggregate outcomes.

What's the best way to chain async processing stages in Tokio?

Pipeline processing chains multiple async stages using channels for inter-stage communication. Each stage receives input, processes it, and forwards output to the next, enabling backpressure control and staged task distribution.

How do I control the rate of operations in a Tokio async application?

Rate limiting in Tokio uses token bucket or leaky bucket approaches to throttle operation frequency. Implement via channels or semaphores to prevent overwhelming downstream systems and manage backpressure.

Can I cancel multiple Tokio tasks hierarchically when shutting down?

Coordinated shutdown with CancellationToken enables hierarchical cancellation across dependent tasks. Propagate tokens through the task tree so parent cancellation triggers cleanup in all child tasks simultaneously.

Does Tokio support executing multiple async tasks in parallel and waiting for all to complete?

Parallel task execution with join in Tokio spawns multiple tasks concurrently and blocks until all finish. Use tokio::join! or task handles to await completion and collect results from parallel async operations.

When should I use advanced concurrency patterns instead of basic async spawning?

Use advanced patterns like fan-out/fan-in and pipelines when handling high-concurrency workloads requiring coordinated task distribution, backpressure control, or multi-stage processing that basic spawning cannot efficiently orchestrate.