Coverage for ion/core/messaging/exchange : 74.14%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
#!/usr/bin/env python
@author Dorian Raymer @author Michael Meisinger @brief ION Exchange manager for CC. """
""" Manager class for capability container exchange management. """
# Container broker connection / vhost parameters
# Default exchange space
# Life cycle
""" """
# Configure the broker connection
username, password = open(credfile).read().split()
# Is a BrokerConnection instance (no action at this point) hostname=hostname, port=port, virtual_host=virtual_host, username=username, password=password, heartbeat=heartbeat)
def on_activate(self, *args, **kwargs): """ @retval Deferred """ # Initiate the broker connection message_space=self.message_space, name=DEFAULT_EXCHANGE_SPACE)
def on_terminate(self, *args, **kwargs): """ @retval Deferred """
# Close the broker connection
raise RuntimeError("Illegal state change for ExchangeManager")
# API
def configure_messaging(self, name, config): """ """ if config['name_type'] == 'worker': name_type_f = messaging.worker elif config['name_type'] == 'direct': name_type_f = messaging.direct elif config['name_type'] == 'fanout': name_type_f = messaging.fanout else: raise RuntimeError("Invalid name_type: "+config['name_type'])
amqp_config = name_type_f(name) amqp_config.update(config) res = yield Consumer.name(self.exchange_space, amqp_config) yield self.exchange_space.store.put(name, amqp_config) defer.returnValue(res)
def new_consumer(self, name_config): """ @brief create consumer @retval Deferred that fires a consumer instance """
""" @brief Check if a queue of the given name exists. @retval A Deferred that returns True or False """
""" Sends a message """
""" Event triggered by the messaging manager when the amqp client goes down. The relationship between the exchange manager and the messaging manager is not well defined, so it is only via 'the force' that the messaging manager will understand that it should notify the exchange manager of things like connectionLost """ self.container.exchangeConnectionLost(reason) |