示例#1
0
文件: amqp.py 项目: reedobrien/celery
 def add_compat(self, name, **options):
     # docs used to use binding_key as routing key
     options.setdefault("routing_key", options.get("binding_key"))
     if options["routing_key"] is None:
         options["routing_key"] = name
     q = self[name] = entry_to_queue(name, **options)
     return q
示例#2
0
 def add_compat(self, name, **options):
     # docs used to use binding_key as routing key
     options.setdefault('routing_key', options.get('binding_key'))
     if options['routing_key'] is None:
         options['routing_key'] = name
     q = self[name] = entry_to_queue(name, **options)
     return q
示例#3
0
文件: amqp.py 项目: jalaziz/celery
 def add_compat(self, name, **options):
     # docs used to use binding_key as routing key
     options.setdefault('routing_key', options.get('binding_key'))
     if options['routing_key'] is None:
         options['routing_key'] = name
     if self.ha_policy is not None:
         self._set_ha_policy(options.setdefault('queue_arguments', {}))
     q = self[name] = entry_to_queue(name, **options)
     return q
示例#4
0
 def add_compat(self, name, **options):
     # docs used to use binding_key as routing key
     options.setdefault('routing_key', options.get('binding_key'))
     if options['routing_key'] is None:
         options['routing_key'] = name
     if self.ha_policy is not None:
         self._set_ha_policy(options.setdefault('queue_arguments', {}))
     q = self[name] = entry_to_queue(name, **options)
     return q
示例#5
0
    def __init__(self, connection, from_dict=None, consumers=None,
            callbacks=None, **kwargs):
        self.connection = connection
        self.backend = connection.channel()

        queues = []
        if consumers:
            for consumer in consumers:
                queues.extend(consumer.queues)
        if from_dict:
            for queue_name, queue_options in from_dict.items():
                queues.append(entry_to_queue(queue_name, **queue_options))

        super(ConsumerSet, self).__init__(self.backend, queues, **kwargs)
示例#6
0
    def __init__(self, connection, from_dict=None, consumers=None,
            callbacks=None, **kwargs):
        self.connection = connection
        self.backend = connection.channel()

        queues = []
        if consumers:
            for consumer in consumers:
                queues.extend(consumer.queues)
        if from_dict:
            for queue_name, queue_options in from_dict.items():
                queues.append(entry_to_queue(queue_name, **queue_options))

        super(ConsumerSet, self).__init__(self.backend, queues, **kwargs)
示例#7
0
 def add_consumer_from_dict(self, queue, **options):
     return self.add_queue(entry_to_queue(queue, **options))
示例#8
0
 def test_calls_Queue_from_dict(self):
     with patch('kombu.common.Queue') as Queue:
         entry_to_queue('name', exchange='bar')
         Queue.from_dict.assert_called_with('name', exchange='bar')
示例#9
0
 def add_compat(self, name, **options):
     # docs used to use binding_key as routing key
     options.setdefault("routing_key", options.get("binding_key"))
     q = self[name] = entry_to_queue(name, **options)
     return q
示例#10
0
 def test_calls_Queue_from_dict(self):
     with patch('kombu.common.Queue') as Queue:
         entry_to_queue('name', exchange='bar')
         Queue.from_dict.assert_called_with('name', exchange='bar')
示例#11
0
文件: amqp.py 项目: CoolCold/celery
 def add_compat(self, name, **options):
     # docs used to use binding_key as routing key
     options.setdefault('routing_key', options.get('binding_key'))
     q = self[name] = entry_to_queue(name, **options)
     return q
示例#12
0
 def add_consumer_from_dict(self, queue, **options):
     return self.add_queue(entry_to_queue(queue, **options))
示例#13
0
 def test_calls_Queue_from_dict(self):
     with patch("kombu.common.Queue") as Queue:
         entry_to_queue("name", exchange="bar")
         Queue.from_dict.assert_called_with("name", exchange="bar")