tokio

Rust 언어로 만든 오픈소스 프로젝트예요. 전 세계 개발자 3.4만 명이 스타(좋아요)를 눌렀어요. 깃허브에 올라온 설치파일이 없는 개발자용 프로젝트예요. 마지막 수정은 1일 전이에요.

👩‍💻 개발자용⭐ 3.4만

원문 소개: A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

바로 쓰기

내 상황에 맞는 방법을 하나 고르세요.

깃허브에는 설치파일이 없어요. 앱으로 배포하는 프로젝트라면 공식 사이트에서 받을 수 있는지 확인해 보세요.

브라우저에서 바로 열기 · 설치 없음

내 것으로 가져오기

git clone https://github.com/tokio-rs/tokio.git

git clone: 개발자가 코드를 받는 명령어예요. 수정 내역까지 함께 받아져요.

한눈에 보기

인기⭐ 33,702 스타 · 🍴 4,508 포크
무료 여부MIT
무료이고 회사·상업용으로 써도 돼요. 출처(저작권 표시)만 남기면 돼요.
만든 언어Rust
최신 버전tokio-1.54.1 · 2026년 10월 22일
활동만든 날 2016.9.10 · 최근 수정 1일 전 · 열린 이슈(질문) 451개
공식 사이트tokio.rs

설명서 (README)

만든 사람이 쓴 원문 설명서예요. 영어가 어렵다면 한국어로 번역해서 보기 →

Tokio

A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language. It is:

  • Fast: Tokio's zero-cost abstractions give you bare-metal performance.

  • Reliable: Tokio leverages Rust's ownership, type system, and concurrency model to reduce bugs and ensure thread safety.

  • Scalable: Tokio has a minimal footprint, and handles backpressure and cancellation naturally.

Crates.io MIT licensed Build Status Discord chat

Website | Guides | API Docs | Chat

Overview

Tokio is an event-driven, non-blocking I/O platform for writing asynchronous applications with the Rust programming language. At a high level, it provides a few major components:

  • A multithreaded, work-stealing based task scheduler.
  • A reactor backed by the operating system's event queue (epoll, kqueue, IOCP, etc.).
  • Asynchronous TCP and UDP sockets.

These components provide the runtime components necessary for building an asynchronous application.

Example

A basic TCP echo server with Tokio.

Make sure you enable the full features of the tokio crate on Cargo.toml:

[dependencies]
tokio = { version = "1.54.1", features = ["full"] }

Then, on your main.rs:

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];

            // In a loop, read data from the socket and write the data back.
            loop {
                let n = match socket.read(&mut buf).await {
                    // socket closed
                    Ok(0) => return,
                    Ok(n) => n,
                    Err(e) => {
                        eprintln!("failed to read from socket; err = {:?}", e);
                        return;
                    }
                };

                // Write the data back
                if let Err(e) = socket.write_all(&buf[0..n]).await {
                    eprintln!("failed to write to socket; err = {:?}", e);
                    return;
                }
            }
        });
    }
}

More examples can be found here. For a larger "real world" example, see the mini-redis repository.

To see a list of the available feature flags that can be enabled, check our docs.

Getting Help

First, see if the answer to your question can be found in the Guides or the API documentation. If the answer is not there, there is an active community in the Tokio Discord server. We would be happy to try to answer your question. You can also ask your question on the discussions page.

Contributing

🎈 Thanks for your help improving the project! We are so happy to have you! We have a contributing guide to help you get involved in the Tokio project.

Related Projects

In addition to the crates in this repository, the Tokio project also maintains several other libraries, including:

  • toasty: An async ORM for Rust supporting both SQL and NoSQL databases.

  • axum: A web application framework that focuses on ergonomics and modularity.

  • hyper: A fast and correct HTTP/1.1 and HTTP/2 implementation for Rust.

  • tonic: A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility.

  • warp: A super-easy, composable, web server framework for warp speeds.

  • tower: A library of modular and reusable components for building robust networking clients and servers.

  • tracing (formerly tokio-trace): A framework for application-level tracing and async-aware diagnostics.

  • mio: A low-level, cross-platform abstraction over OS I/O APIs that powers tokio.

  • bytes: Utilities for working with bytes, including efficient byte buffers.

  • loom: A testing tool for concurrent Rust code.

Changelog

The Tokio repository contains multiple crates. Each crate has its own changelog.

Supported Rust Versions

Tokio will keep a rolling MSRV (minimum supported rust version) policy of at least 6 months. When increasing the MSRV, the new Rust version must have been released at least six months ago. The current MSRV is 1.85.

Note that the MSRV is not increased automatically, and only as part of a minor release. The MSRV history for past minor releases can be found below:

  • 1.54 to now - Rust 1.85
  • 1.48 to 1.53 - Rust 1.71
  • 1.39 to 1.47 - Rust 1.70
  • 1.30 to 1.38 - Rust 1.63
  • 1.27 to 1.29 - Rust 1.56
  • 1.17 to 1.26 - Rust 1.49
  • 1.15 to 1.16 - Rust 1.46
  • 1.0 to 1.14 - Rust 1.45

Note that although we try to avoid the situation where a dependency transitively increases the MSRV of Tokio, we do not guarantee that this does not happen. However, every minor release will have some set of versions of dependencies that works with the MSRV of that minor release.

Release schedule

Tokio doesn't follow a fixed release schedule, but we typically make one minor release each month. We make patch releases for bugfixes as necessary.

Bug patching policy

For the purposes of making patch releases with bugfixes, we have designated certain minor releases as LTS (long term support) releases. Whenever a bug warrants a patch release with a fix for the bug, it will be backported and released as a new patch release for each LTS minor version. Our current LTS releases are:

  • 1.51.x - LTS release until March 2027. (MSRV 1.71)
  • 1.53.x - LTS release until September 2027. (MSRV 1.71)

Each LTS release will continue to receive backported fixes for at least a year. If you wish to use a fixed minor release in your project, we recommend that you use an LTS release.

To use a fixed minor version, you can specify the version with a tilde. For example, to specify that you wish to use the newest 1.51.x patch release, you can use the following dependency specification:

tokio = { version = "~1.51", features = [...] }

Previous LTS releases

  • 1.8.x - LTS release until February 2022.
  • 1.14.x - LTS release until June 2022.
  • 1.18.x - LTS release until June 2023.
  • 1.20.x - LTS release until September 2023.
  • 1.25.x - LTS release until March 2024.
  • 1.32.x - LTS release until September 2024.
  • 1.36.x - LTS release until March 2025.
  • 1.38.x - LTS release until July 2025.
  • 1.43.x - LTS release until March 2026.
  • 1.47.x - LTS release until September 2026.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you shall be licensed as MIT, without any additional terms or conditions.

자주 묻는 질문

tokio 무료로 쓸 수 있나요?

네, MIT 라이선스로 공개된 오픈소스예요. 무료이고 회사·상업용으로 써도 돼요. 출처(저작권 표시)만 남기면 돼요. 깃허브 저장소에서 누구나 내려받을 수 있어요.

tokio 설치는 어떻게 하나요?

따로 설치파일이 없어서 README 설명서의 안내를 따라 설치해야 해요. ZIP 다운로드로 전체 코드를 받거나, 브라우저에서 바로 열어 코드를 둘러볼 수 있어요.

코딩을 몰라도 tokio 쓸 수 있나요?

조금 어려울 수 있어요. 완성된 설치파일이 없는 개발자용 프로젝트라서 터미널 명령어나 개발 환경이 필요해요. 처음이라면 Codespaces로 브라우저에서 먼저 실행해 보세요.

tokio 인기는 어느 정도인가요?

깃허브 스타 33,702개, 포크 4,508개를 받은 프로젝트예요. 2016년에 만들어졌고 마지막 수정은 1일 전이에요. 스타가 1만 개를 넘으면 전 세계적으로 검증된 인기 프로젝트로 봐요.

복사했어요