I want to get more comfortable with Tokio, Rust’s async runtime. Learning async Rust can feel intimidating, so I decided to take it step by step.
This is not a universal learning path. It is my personal plan, and I will update the list as I make progress and write dedicated articles for each project.
Beginner Level
-
Async Echo Server
Build a TCP server that accepts connections and echoes messages back.
Concepts:TcpListener
,TcpStream
, spawning tasks withtokio::spawn
. -
Chat Server (Multi-client Echo)
Extend the echo server to broadcast messages from one client to all connected clients.
Concepts: Usingtokio::sync::broadcast
channels for fan-out messaging, managing client lifetimes, handling dropped receivers. -
Simple HTTP Server
Parse basic HTTP requests and return static responses, for example always return “Hello World”.
Concepts: Async I/O parsing, handling request and response framing.
Intermediate Level
-
Async File Downloader
Given a URL, download the file asynchronously usingreqwest
with the Tokio runtime.
Concepts: Async file I/O withtokio::fs
, streaming large responses. -
Key-Value Store Server
Create a TCP server where clients canSET
andGET
keys, similar to a toy Redis.
Concepts: Parsing simple text protocols, storing state in memory,tokio::select!
. -
WebSocket Chat Application
Usetokio-tungstenite
to build a chat app over WebSockets where clients can join rooms.
Concepts: Higher-level protocols over TCP, managing multiple async streams.
Advanced Level
-
Proxy Server (TCP Forwarder)
Build a transparent TCP proxy that forwards traffic between client and target server.
Concepts: Bidirectional stream handling,tokio::io::copy_bidirectional
. -
Async DNS Resolver
Implement a minimal DNS client that sends UDP queries and parses responses.
Concepts: Working withtokio::net::UdpSocket
, binary protocol parsing. -
Task Scheduler / Job Runner
Write a daemon that accepts jobs, for example shell commands, over TCP and runs them concurrently.
Concepts: Process management withtokio::process
, cancellation withtokio::time
, graceful shutdown. -
Miniature Distributed Key-Value Store
Extend your KV store into a cluster where nodes replicate data across the network.
Concepts: Peer-to-peer communication, Raft-like consensus at a basic level, handling network partitions.
Closing Thoughts
This list is my roadmap for learning Tokio. It might change as I progress, and I will keep updating it with links and refinements. If you are also learning async Rust, you might find some useful ideas here.