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
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
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
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)
def add_consumer_from_dict(self, queue, **options): return self.add_queue(entry_to_queue(queue, **options))
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')
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
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
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")