Source code for lwr.messaging

""" This module contains the server-side only code for interfacing with
message queues. Code shared between client and server can be found in
submodules of ``lwr.lwr_client``.

:mod:`lwr.messaging.bind_amqp` Module

.. automodule:: lwr.messaging.bind_amqp


from ..messaging import bind_amqp
from six import itervalues

[docs]def bind_app(app, queue_id, connect_ssl=None): connection_string = __id_to_connection_string(app, queue_id) queue_state = QueueState() for manager in itervalues(app.managers): bind_amqp.bind_manager_to_queue(manager, queue_state, connection_string, connect_ssl) return queue_state
[docs]class QueueState(object): """ Passed through to event loops, should be "non-zero" while queues should be active. """ def __init__(self): = True
[docs] def deactivate(self): = False
def __nonzero__(self): return
def __id_to_connection_string(app, queue_id): return queue_id