Beispiel #1
0
 def create_consumer(self, topic, proxy, fanout=False):
     """Create a consumer that calls a method in a proxy object"""
     if fanout:
         self.declare_fanout_consumer(
             topic, rpc_amqp.ProxyCallback(proxy, Connection.pool))
     else:
         self.declare_topic_consumer(
             topic, rpc_amqp.ProxyCallback(proxy, Connection.pool))
Beispiel #2
0
 def create_consumer(self, topic, proxy, fanout=False):
     """Create a consumer that calls a method in a proxy object"""
     if fanout:
         consumer = FanoutConsumer(self.session, topic,
                                   rpc_amqp.ProxyCallback(proxy))
     else:
         consumer = TopicConsumer(self.session, topic,
                                  rpc_amqp.ProxyCallback(proxy))
     self._register_consumer(consumer)
     return consumer
Beispiel #3
0
    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)
Beispiel #4
0
    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
Beispiel #5
0
    def create_worker(self, topic, proxy, pool_name):
        """Create a worker that calls a method in a proxy object"""
        proxy_cb = rpc_amqp.ProxyCallback(
            self.conf, proxy,
            rpc_amqp.get_connection_pool(self.conf, Connection))

        consumer = TopicConsumer(self.conf,
                                 self.session,
                                 topic,
                                 proxy_cb,
                                 name=pool_name)

        self._register_consumer(consumer)

        return consumer
Beispiel #6
0
 def create_worker(self, topic, proxy, pool_name):
     """Create a worker that calls a method in a proxy object"""
     proxy_cb = rpc_amqp.ProxyCallback(
         self.conf, proxy,
         rpc_amqp.get_connection_pool(self.conf, Connection))
     self.declare_topic_consumer(topic, proxy_cb, pool_name)