Introduction

The first part of this book does not contain any code. It explains some basics about the library we'll build, and the tools we'll use.

  • chapter 1.1 explains what MessagePack-RPC is and what kind of problems is solves
  • chapter 1.2 gives an overview of the Tokio stack

To make it easier to follow and to skip chapters, all the code is also available on github, in the rmp-rpc-demo repository. There is a branch per chapter.

The content of this book is also available on github, so feel free to submit PRs or file issues.

Why this book?

This guide does not intend to be a substitute to the tokio documentation.

Actually, if you're starting with Tokio, you will probably have to look into the official documentation quite often. The intention is to provide a concrete examples of how to build things with Tokio. The documentation does a great job of explaining the concepts behind Tokio and introducing the different pieces of the ecosystem. But there are so many concepts to understand, and so many crates available that it can be hard at the beginning to know what you really need to build something (at least, that's how I felt when I started working on my first crate. By building a real world protocol step by step, we aim at gradually applying the concepts and crates presented in the official documentation.

Who is the target audience?

People who already know the basic concepts of Rust and want to get started with Tokio, but don't really know where to start.

Disclaimer

Two things:

  • I am pretty much a beginner with Tokio and this book has not been reviewed by qualified people yet. It may promote anti-patterns, contain errors, imprecisions, etc.
  • This is work in progress. There are many things I'd like to add: more explanations, more detailed examples, TLS support, graceful shutdown for the server, etc. etc.