1 Hour Async
This is the code accompanying the 1 Hour Dive into Async live-stream.
- The slides are here
- You can watch the recorded event on YouTube
Included Projects
- Block On with Futures. Using
block_on
to start an async runtime. - Block On with Tokio. Using
block_on
with options to start a Tokio runtime. - Hello Tokio. Start a runtime and
await
your first function. - Tokio Joining. Using
join
to run multiple tasks concurrently. Switch between single-threaded and multi-threaded execution to see the difference in output. - Tokio Spawn. Spawn tasks in the background, either detached or for access later.
- Tokio Yield. Yield control from an async task, to ensure another one can run.
- Tokio Select. Select the first of several futures to return.
- Tokio Blocking. The right way and the wrong way to perform a blocking function in Tokio.
- Tokio Spawn Blocking. Spawn a blocking function in the background without tying up the Tokio runtime.
- Tokio MPSC Channels. Create an async channel between tasks.
- Tokio Multiple Channels. Create several channels and select the first one to return.
- Thread to Tokio. Send messages from a thread and into an async process.
- Tokio Stream Generators. You can use streams as generators.
- Tokio File IO as a Stream. Stream files to pace IO, even in a single-threaded runtime.
- Tracing: logging. Setup trace-based logging.
- Tracing: structures. Log to JSON instead.
- Adapting Streams. Adapt a stream in-flight and learn about pinning.