Merge "Move to using the futurist library for async executors"

This commit is contained in:
Jenkins 2015-08-03 19:08:45 +00:00 committed by Gerrit Code Review
commit 6335c15de7
2 changed files with 6 additions and 7 deletions

View File

@ -27,3 +27,4 @@ trollius>=1.0
autobahn>=0.10.1 # MIT License
requests>=2.5.2
taskflow>=1.16.0
futurist>=0.1.2 # Apache-2.0

View File

@ -15,13 +15,12 @@
import uuid
import futurist
from oslo_log import log as logging
import six
from taskflow import engines
from taskflow.patterns import unordered_flow as uf
from taskflow import task
from taskflow.types import futures
from taskflow.utils import eventlet_utils
from zaqar.notification.task import webhook
@ -35,12 +34,11 @@ class NotifierDriver(object):
def __init__(self, *args, **kwargs):
self.subscription_controller = kwargs.get('subscription_controller')
if eventlet_utils.EVENTLET_AVAILABLE:
self.executor = futures.GreenThreadPoolExecutor()
else:
try:
self.executor = futurist.GreenThreadPoolExecutor()
except RuntimeError:
# TODO(flwang): Make the max_workers configurable
self.executor = futures.ThreadPoolExecutor(max_workers=10)
self.executor = futurist.ThreadPoolExecutor(max_workers=10)
def _generate_task(self, subscriber_uri, message):
task_name = uuid.uuid4()