A runtime for writing reliable asynchronous applications with Rust
open sourceMITself-hostablefree
Tokio is the most widely used asynchronous runtime for Rust: an event-driven, non-blocking I/O platform with a multithreaded, work-stealing task scheduler, a reactor on the operating system's event queue (epoll, kqueue, IOCP), and async TCP, UDP and Unix sockets, timers, file system, process and signal APIs. Its sync module has channels (oneshot, mpsc, watch, broadcast), an async Mutex and barriers, and spawn_blocking moves blocking or CPU-heavy work to a separate thread pool. The same project maintains axum, Hyper, Tonic, Tower, tracing, mio and bytes; Tokio has LTS minor releases (1.51.x and 1.53.x today) and a rolling MSRV of at least six months, and is MIT licensed.
Problems it solves
- handle thousands of network connections in Rust without a thread per connection
- run async Rust code: I need an executor for my futures
- async TCP and UDP servers in Rust
- send messages between async tasks in Rust with channels
- time out a slow network call or run something every few seconds in async Rust
- call blocking code or heavy computation from async Rust without stalling other tasks
- spawn and wait on child processes asynchronously in Rust
- handle Ctrl-C and Unix signals gracefully in an async Rust service
- a Rust async runtime with long-term support releases for a production service
- test async Rust code with a paused, controllable clock
Features
- multithreaded work-stealing scheduler and a current-thread runtime
- reactor on epoll, kqueue and IOCP
- async TCP, UDP and Unix domain sockets
- timers: sleep, timeout, interval
- channels: oneshot, mpsc, watch, broadcast; async Mutex, RwLock, Semaphore, Barrier
- async file system, process and signal APIs
- spawn_blocking thread pool for blocking and CPU-bound work
- #[tokio::main] and #[tokio::test] macros
- feature flags to compile only what you use
- test-util for testing with a controllable clock
View 3 more
- LTS releases: 1.51.x until March 2027, 1.53.x until September 2027
- rolling MSRV of at least six months (currently Rust 1.85)
- limited WebAssembly support
Limitations
- Limited WebAssembly support: only the sync, macros, io-util, rt and time features build for Wasm1
Alternatives
The same job
These do what Tokio does.
