In this section, we will be considering another way to implement threading/multiprocessing: the concurrent.futures module, which is designed to be a high-level interface for implementing asynchronous tasks. Specifically, the concurrent.futures module works seamlessly with the asyncio module, and, in addition, it provides an abstract class called Executor, which contains the skeleton of the two main classes that implement asynchronous threading and multiprocessing, respectively (as suggested by their names): ThreadPoolExecutor and ProcessPoolExecutor.
concurrent.futures as a solution for blocking tasks
Changes in the framework
Before we jump into the API from concurrent.futures, let's discuss the theoretical basics of...