concurrent.futures as a solution for blocking tasks

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.

Get Advanced Python Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.