Summary
In this chapter, we managed to revisit async programming. Initially, we explored the Tokio framework by looking into what the Tokio framework enabled us to do and then implementing basic async code, which was then implemented by the Tokio framework. We then increased the number of worker threads to demonstrate the point that we get diminishing returns when we simply increase the number of worker threads. We then worked with channels to facilitate sending messages through these channels. This enabled us to send data between different areas of the code even if the code is running in a different thread.
However, while async programming with the Tokio framework is interesting and fun, the basic combination of Tokio and async programming with channels does not directly lead to practical applications by itself. To gain some practical skills with Tokio and async programming, we explored the actor framework. This is where we define structs with their own state, and then communicate...