Fully use futurist code-base to abstract concurrent.futures away
Change-Id: Iafa789f20d1ac365fe9da2ede2b2fa03a3b8720f
This commit is contained in:
		@@ -15,10 +15,9 @@
 | 
			
		||||
#    under the License.
 | 
			
		||||
 | 
			
		||||
import collections
 | 
			
		||||
import functools
 | 
			
		||||
import threading
 | 
			
		||||
 | 
			
		||||
from concurrent import futures
 | 
			
		||||
from futurist import waiters
 | 
			
		||||
from oslo_config import cfg
 | 
			
		||||
from oslo_utils import excutils
 | 
			
		||||
 | 
			
		||||
@@ -54,8 +53,7 @@ class PooledExecutor(base.ExecutorBase):
 | 
			
		||||
    _executor_cls = None
 | 
			
		||||
 | 
			
		||||
    # Blocking function that should wait for all provided futures to finish.
 | 
			
		||||
    _wait_for_all = functools.partial(futures.wait,
 | 
			
		||||
                                      return_when=futures.ALL_COMPLETED)
 | 
			
		||||
    _wait_for_all = staticmethod(waiters.wait_for_all)
 | 
			
		||||
 | 
			
		||||
    def __init__(self, conf, listener, dispatcher):
 | 
			
		||||
        super(PooledExecutor, self).__init__(conf, listener, dispatcher)
 | 
			
		||||
 
 | 
			
		||||
@@ -37,18 +37,6 @@ kombu>=3.0.7
 | 
			
		||||
# middleware
 | 
			
		||||
oslo.middleware>=2.4.0 # Apache-2.0
 | 
			
		||||
 | 
			
		||||
# FIXME: concurrent.futures is part of the Python stdlib since Python 3.2,
 | 
			
		||||
# but the requirements is still needed because of a bug in tox:
 | 
			
		||||
# https://bitbucket.org/hpk42/tox/issue/236/tox-must-create-the-source-distribution
 | 
			
		||||
#
 | 
			
		||||
# Tox builds a source distribution with "python setup.py sdist" which uses
 | 
			
		||||
# requirements.txt even if tox wants to build the py34 virtual environment.
 | 
			
		||||
# As a consequence, oslo.messaging.egg_info/requires.txt contains futures
 | 
			
		||||
# and oslo_messaging.tests.test_opts.OptsTestCase.test_entry_point fails.
 | 
			
		||||
#
 | 
			
		||||
# for the futures based executor
 | 
			
		||||
futures>=3.0;python_version=='2.7' or python_version=='2.6'
 | 
			
		||||
 | 
			
		||||
# needed by the aioeventlet executor
 | 
			
		||||
aioeventlet>=0.4
 | 
			
		||||
trollius>=1.0
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user