tokio-rs/tokio
Developer ToolsA Rust runtime for building fast, reliable asynchronous networked applications with tasks, timers, and non-blocking I/O.
What it does
Tokio is an event-driven, non-blocking I/O runtime for Rust. It supplies the pieces that an async application needs but that the language itself does not provide: a multithreaded work-stealing task scheduler, a reactor built on the OS event queue (epoll, kqueue, IOCP), and asynchronous TCP/UDP sockets overview.
It targets Rust developers building network services, clients, and other concurrent programs that need to handle many connections or timers without one thread per operation. The crate ships as several packages in one repository: tokio, tokio-util, tokio-stream, tokio-macros, and tokio-test changelogs.
Quick start
Add the runtime to a Cargo project, enabling the full feature set for the example below:
[dependencies]
tokio = { version = "1.54.1", features = ["full"] }
Then write a TCP echo server in main.rs using the #[tokio::main] macro, which sets up the runtime and drives the async main function example:
use tokio::net::TcpListener;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let listener = TcpListener::bind("127.0.0.1:8080").await?;
loop {
let (mut socket, _) = listener.accept().await?;
tokio::spawn(async move {
let mut buf = [0; 1024];
loop {
let n = match socket.read(&mut buf).await {
Ok(0) => return,
Ok(n) => n,
Err(e) => { eprintln!("read error: {:?}", e); return; }
};
if let Err(e) = socket.write_all(&buf[0..n]).await {
eprintln!("write error: {:?}", e);
return;
}
}
});
}
}
Running it with cargo run and connecting to port 8080 should echo back whatever bytes are sent. More complete samples live in the repository's examples directory, and mini-redis shows a larger real-world application. A step-by-step guide is available on the Tokio tutorial.
Feature flags and API
Tokio is split into optional capabilities; leave features = ["full"] off in production and enable only the pieces you use. The list of flags is documented in the feature flag reference. The full crate API is on docs.rs.
Versioning and support
The project follows a rolling minimum supported Rust version (MSRV) policy of at least six months; the current MSRV is Rust 1.85 supported versions. It does not keep a fixed release schedule, but typically publishes a minor release each month, with patch releases for bugs release schedule.
Two LTS minor lines receive backported bug fixes: 1.51.x until March 2027 and 1.53.x until September 2027. Pinning a fixed minor version with a tilde, e.g. tokio = { version = "~1.51", features = [...] }, is the recommended way to use an LTS release LTS policy.
Community and related crates
The wider Tokio project maintains complementary libraries for HTTP (hyper), gRPC (tonic), web frameworks (axum, warp), tracing, and low-level I/O (mio, bytes) related projects. Questions can go to the Tokio Discord or GitHub discussions. The code is MIT licensed license.
HotRepo's take
Tokio appeared on the Rust daily trending list on 2026-11-06 at position 5, with 89 stars gained that day against a base of 33,618 stars and 4,500 forks. It was also posted to Hacker News in April 2020, where it drew 143 points and 58 comments, including a maintainer offering to answer questions HN thread. That discussion circled around whether async/await in Rust requires a runtime and what "zero-cost abstractions" means relative to hand-written code example. The answer remains the architectural point of the project: Rust supplies the async syntax, while a runtime like Tokio supplies the scheduler and I/O driver that make it execute.
Written by AI from the project's README, updated . The project's own docs are the source of truth.