In this lesson, you’ll see that using the concurrent.futures
module is the newer way of doing asynchronous computation in Python. It has a clean interface for working with process pools and thread pools and is only available in Python 3.
You’ll replace your multiprocessing
code with code from the concurrent.futures
module. When working with this new module, you use various classes that have Executor
in their names. There are different execution strategies for how your code is run in parallel, whether that’s across multiple processes or multiple threads within a single process, and they all follow the context manager protocol.