🎯

async-programming

🎯Skill

from pluginagentmarketplace/custom-plugin-rust

VibeIndex|
What it does

Enables efficient concurrent and non-blocking Rust programming using async/await and Tokio runtime for scalable asynchronous tasks.

πŸ“¦

Part of

pluginagentmarketplace/custom-plugin-rust(12 items)

async-programming

Installation

Add MarketplaceAdd marketplace to Claude Code
/plugin marketplace add pluginagentmarketplace/custom-plugin-rust
Install PluginInstall plugin from marketplace
/plugin install rust-development-assistant@pluginagentmarketplace-rust
git cloneClone repository
git clone https://github.com/pluginagentmarketplace/custom-plugin-rust.git
Claude CodeAdd plugin in Claude Code
/plugin load .
πŸ“– Extracted from docs: pluginagentmarketplace/custom-plugin-rust
3Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

Master Rust async/await with Tokio

Overview

# Async Programming Skill

Master Rust's asynchronous programming with async/await and Tokio.

Quick Start

Basic Setup

```toml

# Cargo.toml

[dependencies]

tokio = { version = "1", features = ["full"] }

```

```rust

use tokio;

#[tokio::main]

async fn main() {

let result = fetch_data().await;

println!("{:?}", result);

}

async fn fetch_data() -> String {

// Async operation

tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;

"Data fetched".to_string()

}

```

Spawning Tasks

```rust

use tokio;

#[tokio::main]

async fn main() {

// Spawn concurrent task

let handle = tokio::spawn(async {

expensive_operation().await

});

// Do other work...

// Wait for result

let result = handle.await.unwrap();

}

```

Concurrent Execution

```rust

// Run multiple futures concurrently

let (r1, r2, r3) = tokio::join!(

fetch_user(1),

fetch_user(2),

fetch_user(3),

);

// Race futures - first to complete wins

tokio::select! {

result = operation_a() => println!("A: {:?}", result),

result = operation_b() => println!("B: {:?}", result),

}

```

Common Patterns

Timeout

```rust

use tokio::time::{timeout, Duration};

match timeout(Duration::from_secs(5), slow_operation()).await {

Ok(result) => println!("Completed: {:?}", result),

Err(_) => println!("Timed out"),

}

```

Channels

```rust

use tokio::sync::mpsc;

let (tx, mut rx) = mpsc::channel(32);

tokio::spawn(async move {

tx.send("message").await.unwrap();

});

while let Some(msg) = rx.recv().await {

println!("Got: {}", msg);

}

```

Mutex

```rust

use std::sync::Arc;

use tokio::sync::Mutex;

let data = Arc::new(Mutex::new(0));

let data_clone = Arc::clone(&data);

tokio::spawn(async move {

let mut lock = data_clone.lock().await;

*lock += 1;

});

```

HTTP Client Example

```rust

use reqwest;

#[tokio::main]

async fn main() -> Result<(), reqwest::Error> {

let response = reqwest::get("https://api.example.com/data")

.await?

.json::()

.await?;

println!("{:?}", response);

Ok(())

}

```

Resources

  • [Tokio Tutorial](https://tokio.rs/tokio/tutorial)
  • [Async Book](https://rust-lang.github.io/async-book/)