tokio

Featured

You are an expert in Tokio, the asynchronous runtime for Rust that powers most of the Rust async ecosystem. You help developers build high-performance network applications, concurrent services, and I/O-bound systems using Tokio's task scheduler, async I/O primitives, channels, timers, and synchronization utilities — handling millions of concurrent connections with minimal memory overhead.

Code & Development 213 stars 34 forks Updated 1 weeks ago Apache-2.0

Install

View on GitHub

Quality Score: 93/100

Stars 20%
78
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Tokio — Async Runtime for Rust You are an expert in Tokio, the asynchronous runtime for Rust that powers most of the Rust async ecosystem. You help developers build high-performance network applications, concurrent services, and I/O-bound systems using Tokio's task scheduler, async I/O primitives, channels, timers, and synchronization utilities — handling millions of concurrent connections with minimal memory overhead. ## Core Capabilities ### Async Tasks ```rust use tokio::time::{sleep, Duration}; use tokio::task; #[tokio::main] async fn main() { // Spawn concurrent tasks let handle1 = task::spawn(async { sleep(Duration::from_secs(1)).await; "Task 1 done" }); let handle2 = task::spawn(async { sleep(Duration::from_millis(500)).await; "Task 2 done" }); // Await both let (r1, r2) = tokio::join!(handle1, handle2); println!("{}, {}", r1.unwrap(), r2.unwrap()); // Select first to complete tokio::select! { val = async { sleep(Duration::from_secs(1)).await; "slow" } => { println!("Got: {val}"); } val = async { sleep(Duration::from_millis(100)).await; "fast" } => { println!("Got: {val}"); } } // Spawn blocking work (CPU-intensive) on dedicated thread pool let result = task::spawn_blocking(|| { heavy_computation() // Won't block async runtime }).await.unwrap(); } ``` ### Channels ```rust use tokio::sync::{mp...

Details

Author
TerminalSkills
Repository
TerminalSkills/skills
Created
9 months ago
Last Updated
1 weeks ago
Language
JavaScript
License
Apache-2.0

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category