I would like to use the nice executors and threadpooling APIs but I am constrained to a Python 2 environment. I cannot upgrade to Python 3 due to another third party dependency.
The closest answer I found is: Concurrent in Python 2
Another solution, than using of explicit locks, is to use a data structure that supports concurrent access. For example, we can use the queue module, which provides thread-safe queues. We can also use multiprocessing. JoinableQueue classes for multiprocessing-based concurrency.
The concurrent. futures module provides a high-level interface for asynchronously executing callables. The asynchronous execution can be performed with threads, using ThreadPoolExecutor , or separate processes, using ProcessPoolExecutor .
A concurrent installation action installs another Windows Installer package during a currently running installation. A concurrent installation is added to a package by authoring a concurrent installation action into the CustomAction table and scheduling this custom action into the sequence tables.
Future is an awaitable object. Coroutines can await on Future objects until they either have a result or an exception set, or until they are cancelled. A Future can be awaited multiple times and the result is same.
Found the following package for Python 2: https://pypi.python.org/pypi/futures
It says: Backport of the concurrent.futures package from Python 3.2
Trying it out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With