Using the concurrent.futures Python modules
With the release of Python 3.2, the concurrent.future
module was introduced, which allows us to manage concurrent programming tasks, such as process and thread pooling, nondeterministic execution flows, and processes and thread synchronization.
This package is built by the following classes:
concurrent.futures.Executor
: This is an abstract class that provides methods to execute calls asynchronously.submit (function ,argument)
: This schedules the execution of a function (called callable) on the arguments.map (function,argument)
: This executes the function on arguments in an asynchronous mode.shutdown (Wait = True)
: This signals the executor to free any resource.concurrent.futures.Future
: This encapsulates ...
Get Python Parallel Programming Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.