Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a python 2 backport for the concurrency.futures package from python 3

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

like image 869
Tapomay Avatar asked Feb 21 '17 20:02

Tapomay


People also ask

Which module can be used to implement concurrency in Python 3?

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.

What is Python concurrent futures?

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 .

How do I install Concurrent?

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.

What is future object in Python?

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.


1 Answers

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.

like image 163
Tapomay Avatar answered Sep 28 '22 20:09

Tapomay