def create_consumer(self, topic, proxy, fanout=False): """Create a consumer that calls a method in a proxy object""" proxy_cb = rpc_amqp.ProxyCallback(self.conf, proxy, rpc_amqp.get_connection_pool(self, Connection)) if fanout: self.declare_fanout_consumer(topic, proxy_cb) else: self.declare_topic_consumer(topic, proxy_cb)
def create_consumer(self, topic, proxy, fanout=False): """Create a consumer that calls a method in a proxy object""" proxy_cb = rpc_amqp.ProxyCallback(self.conf, proxy, rpc_amqp.get_connection_pool(self, Connection)) if fanout: consumer = FanoutConsumer(self.conf, self.session, topic, proxy_cb) else: consumer = TopicConsumer(self.conf, self.session, topic, proxy_cb) self._register_consumer(consumer) return consumer
def notify(conf, context, topic, msg): """Sends a notification event on a topic.""" return rpc_amqp.notify(conf, context, topic, msg, rpc_amqp.get_connection_pool(conf, Connection))
def fanout_cast_to_server(conf, context, server_params, topic, msg): """Sends a message on a fanout exchange to a specific server.""" return rpc_amqp.fanout_cast_to_server(conf, context, server_params, topic, msg, rpc_amqp.get_connection_pool(conf, Connection))
def fanout_cast(conf, context, topic, msg): """Sends a message on a fanout exchange without waiting for a response.""" return rpc_amqp.fanout_cast(conf, context, topic, msg, rpc_amqp.get_connection_pool(conf, Connection))
def call(conf, context, topic, msg, timeout=None): """Sends a message on a topic and wait for a response.""" return rpc_amqp.call(conf, context, topic, msg, timeout, rpc_amqp.get_connection_pool(conf, Connection))
def multicall(conf, context, topic, msg, timeout=None): """Make a call that returns multiple times.""" return rpc_amqp.multicall(conf, context, topic, msg, timeout, rpc_amqp.get_connection_pool(conf, Connection))
def create_connection(conf, new=True): """Create a connection""" return rpc_amqp.create_connection(conf, new, rpc_amqp.get_connection_pool(conf, Connection))