Building an asynchronous redis server

Now that we're familiar with the asynchronous I/O solutions that the Rust ecosystem provides, it's time to revisit our Redis server implementation. We'll port our rudis_sync server to the asynchronous version using the tokio and futures crates. As with any asynchronous code, using futures and tokio can be daunting at first, and it can take time getting used to its API. However, We'll try to make things easy to understand here. Let's start by creating our project by running cargo new rudis_async with the following dependencies in Cargo.toml:

# rudis_async/Cargo.toml[dependencies]tokio = "0.1.13"futures = "0.1.25"lazy_static = "1.2.0"resp = { git = "https://github.com/creativcoder/resp" }tokio-codec = "0.1.1" ...

Get Mastering Rust - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.