Tokio

The async runtime powering most of Rust's networked, concurrent, and I/O-bound applications.

Framework
Cargo
v1.53.2
33,407 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
93 /100 Excellent
Development Activity 100
Maintenance 96
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
91 /100 Excellent
Architecture 94
Code Quality 92
Innovation 88
Learning Curve 88

Tokio is the de facto asynchronous runtime for Rust, providing the task scheduler, I/O reactor, and timer that async/await code needs to actually run. It exposes non-blocking TCP/UDP/Unix-socket networking, filesystem access, process and signal handling, and a full suite of async-aware synchronization primitives (channels, mutexes, semaphores) behind a granular set of Cargo feature flags.

Rather than a small utility crate, Tokio functions as the execution engine underneath most production Rust network services: it drives everything from single-threaded, embedded-style event loops to multi-threaded, work-stealing schedulers handling hundreds of thousands of concurrent connections, and its #[tokio::main] macro is the entry point for a large share of async Rust programs.

What You Get

  • A configurable multi-threaded or single-threaded async task scheduler with work-stealing
  • Non-blocking TCP, UDP, and Unix socket networking plus async filesystem operations
  • Async-aware synchronization primitives: mpsc/oneshot/broadcast/watch channels, Mutex, RwLock, Semaphore
  • Timers, sleeps, intervals, and timeouts driven by an efficient hierarchical timing wheel
  • The #[tokio::main] and #[tokio::test] macros for zero-boilerplate runtime bootstrapping

Common Use Cases

  • Building high-throughput network servers (HTTP, gRPC, WebSocket, custom TCP protocols)
  • Powering async web frameworks and database drivers that need a shared runtime underneath
  • Coordinating concurrent background jobs, timers, and IPC in long-running services

Under The Hood

Architecture The crate’s public surface at tokio/src/lib.rs re-exports a set of modules — runtime, net, io, fs, sync, process, signal, task, and time — built on an internal runtime engine under tokio/src/runtime/. That engine splits into a scheduler/ (work-stealing multi-thread scheduler plus a lighter current-thread scheduler), driver/ (an I/O reactor built on mio that maps onto epoll, kqueue, or IOCP depending on platform), time/ (a hierarchical timing wheel), task/ (the task system backing JoinHandle and task IDs), context/ (thread-local runtime context so nested async calls can find the active runtime), and blocking/ (a dedicated thread pool for spawn_blocking). The #[tokio::main] proc macro, implemented in the separate tokio-macros crate, expands to a Runtime::Builder call followed by .block_on(...), making the macro the literal entry point that boots the scheduler, reactor, and timer before user code runs.

Tech Stack The crate targets Rust 2021 edition with an MSRV of 1.71. Its core dependencies are deliberately minimal: mio for cross-platform OS event-queue abstraction, pin-project-lite for safe self-referential pinning without full proc-macro overhead, bytes for buffer management, socket2 for low-level socket configuration, parking_lot as an optional faster mutex, and signal-hook-registry/windows-sys for Unix and Windows signal handling respectively. The repository is a Cargo workspace of tightly coupled crates — tokio (core runtime), tokio-macros (attribute macros), tokio-stream (Stream trait adapters), tokio-util (codec/framing helpers), and tokio-test (testing utilities) — with nearly every capability (fs, net, sync, rt, time, macros, process, signal, io-uring) gated behind an opt-in Cargo feature so unused code paths never enter a downstream build; a single full feature enables everything at once.

Code Quality The tokio crate ships 173 integration test files under tokio/tests/ alongside embedded unit-test modules in src/runtime/tests, src/sync/tests, and src/runtime/time/tests. lib.rs enforces #![warn(missing_debug_implementations, missing_docs, rust_2018_idioms, unreachable_pub)] and #![deny(unused_must_use, unsafe_op_in_unsafe_fn)], and the crate uses loom, a concurrency-permutation testing library, under src/loom to exhaustively check atomic and lock-free code paths for correctness — a strong signal of rigor for a runtime whose 140 files touching unsafe sit behind an otherwise safe public API. A deny.toml drives cargo-deny dependency auditing and a fuzz/ directory adds fuzz-testing coverage on top of the test suite.

API Design Tokio’s async surface mirrors the Rust standard library’s synchronous I/O types (TcpListener, File) and channel primitives, so existing Rust knowledge transfers with minimal relearning. The #[tokio::main] macro collapses runtime bootstrapping to a single attribute, and the feature-flag system lets consumers pull in only what they use, at the cost of newcomers occasionally hitting confusing ‘not found in tokio’ compile errors until they enable the right flag. Nearly every public item carries a runnable rustdoc example, docs.rs annotates which feature flag gates each item via doc(cfg), and the repository ships 22 example programs (echo server, chat server, proxy, priority queue) plus a separate long-form tutorial at tokio.rs/tokio/tutorial.

Used by 144 apps in this directory

Rust
60%
GPL 3.0

openfootmanager

Game Development

1,135

A free and open source football management simulation game built with Rust and Tauri, inspired by Football Manager.

View details
95
Repo Health
79
Technical
73
Dependency
Built with
Rust 60%
TypeScript 39%
Updated yesterday
Rust
91%
MIT

OpenPencil

AI Design Tools

6,114

An open-source, AI-native vector design tool with concurrent agent teams, design-as-code, a built-in MCP server, and multi-model intelligence — a distinct project from the similarly-named Figma-file-reading "open-pencil" editor.

View details
81
Repo Health
70
Technical
75
Dependency
Built with
Rust 91%
Updated today
Rust
86%
Apache 2.0

OpenShell

AI Agents · Developer Tools

15,629

The safe, private runtime that lets autonomous AI agents operate in sandboxed environments governed by declarative YAML policies — blocking data exfiltration, credential leaks, and unauthorized network activity before they happen.

View details
86
Repo Health
81
Technical
68
Dependency
Built with
Rust 86%
Updated today
TypeScript
93%
Apache 2.0

Openship

Devops · Hosting Control Panel

14,642

Openship is an open-source, self-hostable deployment platform that points at a repo and builds, ships, routes, and TLS-terminates the app — driven from a desktop app, web dashboard, or CLI.

View details
84
Repo Health
85
Technical
65
Dependency
Built with
TypeScript 93%
Updated today
Python
74%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

39,552

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 74%
Rust 12%
TypeScript 11%
Updated today
TypeScript
90%
MIT

openwork

AI Assistants · Automation

23,985

OpenWork is a free, open-source desktop app for running AI agent workflows on your own files with 50+ LLMs, extensible skills, and MCP server support — the open-source alternative to Claude Cowork and Codex.

View details
87
Repo Health
89
Technical
67
Dependency
Built with
TypeScript 90%
Updated today
Rust
99%
GPL 3.0

Pake

Developer Tools

61,964

Turn any webpage into a lightweight native desktop app with one command — built on Rust/Tauri instead of Electron, producing installers nearly 20x smaller (typically under 10MB) for macOS, Windows, and Linux.

View details
94
Repo Health
75
Technical
72
Dependency
Built with
Rust 99%
Updated today
Rust
85%
AGPL 3.0

ParadeDB

Analytics · Databases · Search

9,385

Born out of Y Combinator's S2023 batch, ParadeDB is a Postgres extension that delivers Elasticsearch-quality BM25 search and real-time analytics without a separate search cluster to manage.

View details
89
Repo Health
87
Technical
68
Dependency
Built with
Rust 85%
PLpgSQL 14%
Updated today
Go
82%
AGPL 3.0

PeerDB

Data Engineering · Databases

3,299

Postgres-native ETL that streams change data capture in real time to Snowflake, BigQuery, ClickHouse, S3, and Kafka — up to 10x faster than general-purpose pipelines, managed through a familiar Postgres SQL interface.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
Go 82%
TypeScript 12%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers