Summary

In this chapter, we looked at how to use thread pools in microservices. We investigated three approaches: using plain threads, using the futures-cpupool crate, and using the tokio-threadpool crate. We used channels from the futures crate to interact with threads from asynchronous code. Special crates do all the interaction automatically; all you need to do is call a function that will be executed in a separate thread.

Also, we got acquainted with the actix crate and the actors model, which helps to split and run tasks as separate units that are managed by a smart runtime.

In the next chapter, we'll learn how to interact with different databases using Rust, including PostgreSQL, MySQL, Redis, MongoDB, and DynamoDB.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.227.82