Per-task concurrency Per-task concurrency Both tokio::spawn and select! enable running concurrent asynchronous operations. However, the strategy used to run concurrent operat...
Streams The Stream trait Fibonacci Getting asynchronous Combinators Essential combinators Concrete streams Adapters Streams Streams are similar to futures, but instea...
Accepting sockets Accepting sockets The first thing our Redis server needs to do is to accept inbound TCP sockets. This is done with tokio::net::TcpListener . Many of Tokio’...
Implementing futures The Future trait. Running the future Cleaning things up Implementing futures Implementing futures is very common when using Tokio. Let’s start with a...
Pattern matching Pattern matching Recall that the select! macro branch syntax was defined as: <pattern> = <async expression > => <handler> , So far, we have only use...
Wakers Updating Delay Updating Mini Tokio Wakers Wakers are the missing piece. This is the system by which a resource is able to notify the waiting task that the resource ha...
Return value Return value The tokio::select! macro returns the result of the evaluated <handler> expression. async fn computation1 () -> String { // .. computat...
Async in depth Futures Implementing Future Async fn as a Future Executors Mini Tokio Wakers Updating Delay Updating Mini Tokio Summary A few loose ends Notify utility ...