Guide contents

Master Tokio Runtime

Learn Tokio from zero to advanced: async basics, tasks, timers, channels, networking, streams, the scheduler and reactor internals, production practices, 27 practical projects, and interview questions.

44 lessons in 10 sections

Start with Introduction: How This Course Works →

Getting Started

What async is, why Tokio exists, and how the course works.

  1. 1.Introduction: How This Course Works
  2. 2.Threads, Async, and Where Tokio Fits
  3. 3.Your First Tokio Program

Async Foundations

Futures, async and await, wakers, and a small executor built by hand.

  1. 4.Futures and async/await
  2. 5.Polling, Wakers, and a Tiny Executor

Tasks and Time

Spawning, joining, cancelling, racing, blocking work, and timers.

  1. 6.Spawning Tasks
  2. 7.join!, try_join!, and Running Work Concurrently
  3. 8.Cancellation, abort, and Panics
  4. 9.select!: Racing Futures
  5. 10.Blocking and CPU-Bound Work
  6. 11.Time: sleep, timeout, and interval
  7. 12.Workshop 1: Tasks and Time

Shared State and Channels

Async mutexes, semaphores, notifications, and the four channel types.

  1. 13.Shared State: Mutex and RwLock
  2. 14.Semaphore, Notify, Barrier, and OnceCell
  3. 15.mpsc Channels
  4. 16.oneshot, broadcast, and watch
  5. 17.Workshop 2: Shared State and Channels

Async I/O

AsyncRead and AsyncWrite, TCP, UDP, Unix sockets, files, processes, and signals.

  1. 18.AsyncRead and AsyncWrite
  2. 19.TCP Clients and Servers
  3. 20.UDP and Unix Sockets
  4. 21.Files, Processes, and Signals
  5. 22.Workshop 3: Async I/O

Concurrency Patterns

Structured concurrency, graceful shutdown, backpressure, and actors.

  1. 23.JoinSet and Structured Concurrency
  2. 24.Graceful Shutdown
  3. 25.Backpressure and Load Shedding
  4. 26.Actors, Worker Pools, and Pipelines
  5. 27.Workshop 4: Concurrency Patterns

Streams and Protocols

Streams, byte buffers, framing, and codecs.

  1. 28.Streams
  2. 29.Bytes and Framing
  3. 30.Codecs with tokio-util
  4. 31.Workshop 5: Streams and Protocols

Runtime Internals

Custom futures, runtime configuration, the scheduler, the reactor, timers, and task layout.

  1. 32.Writing Futures and Streams by Hand
  2. 33.Runtime Builder and the Scheduler
  3. 34.The Reactor, the Timer Wheel, and Task Layout
  4. 35.Workshop 6: Runtime Internals

Production Tokio

Error handling, tracing, testing, performance, pitfalls, and the wider ecosystem.

  1. 36.Error Handling in Async Code
  2. 37.Tracing and Observability
  3. 38.Testing Async Code
  4. 39.Performance and Tuning
  5. 40.Common Pitfalls and How to Debug Them
  6. 41.The Tokio Ecosystem
  7. 42.Workshop 7: Production Practice

Interview Practice

Tokio questions and answers, coding problems, and design questions for senior and lead roles.

  1. 43.Interview Questions: Concepts, Internals, and Production
  2. 44.Interview Coding, Bug-Spotting, and Design Questions