Ejemplo n.º 1
0
def get_executor(method):
    if eventletutils.is_monkey_patched('thread'):
        from oslo_messaging._drivers.zmq_driver.poller import green_poller
        return green_poller.GreenExecutor(method)

    from oslo_messaging._drivers.zmq_driver.poller import threading_poller
    return threading_poller.ThreadingExecutor(method)
Ejemplo n.º 2
0
def get_executor(method, zmq_concurrency='eventlet'):
    _raise_error_if_invalid_config_value(zmq_concurrency)

    if zmq_concurrency == 'eventlet' and _is_eventlet_zmq_available():
        from oslo_messaging._drivers.zmq_driver.poller import green_poller
        return green_poller.GreenExecutor(method)

    from oslo_messaging._drivers.zmq_driver.poller import threading_poller
    return threading_poller.ThreadingExecutor(method)
Ejemplo n.º 3
0
def get_executor(method, zmq_concurrency='eventlet'):
    _raise_error_if_invalid_config_value(zmq_concurrency)

    if zmq_concurrency == 'eventlet' and _is_eventlet_zmq_available():
        return green_poller.GreenExecutor(method)
    return threading_poller.ThreadingExecutor(method)