Esempio n. 1
0
    def __init__(self,
                 channel,
                 queues,
                 no_ack=None,
                 auto_declare=None,
                 callbacks=None,
                 on_decode_error=None):
        self.channel = channel
        self.queues = queues
        if no_ack is not None:
            self.no_ack = no_ack
        if auto_declare is not None:
            self.auto_declare = auto_declare
        if on_decode_error is not None:
            self.on_decode_error = on_decode_error

        if callbacks is not None:
            self.callbacks = callbacks
        if self.callbacks is None:
            self.callbacks = []
        self._active_tags = {}

        self.queues = [
            queue(self.channel) for queue in maybe_list(self.queues)
        ]

        if self.auto_declare:
            self.declare()
Esempio n. 2
0
    def __init__(self, channel, queues, no_ack=None, auto_declare=None,
            callbacks=None, on_decode_error=None):
        from kombu.connection import BrokerConnection
        if isinstance(channel, BrokerConnection):
            channel = channel.default_channel
        self.channel = channel
        self.connection = self.channel.connection.client

        self.queues = queues
        if no_ack is not None:
            self.no_ack = no_ack
        if auto_declare is not None:
            self.auto_declare = auto_declare
        if on_decode_error is not None:
            self.on_decode_error = on_decode_error

        if callbacks is not None:
            self.callbacks = callbacks
        if self.callbacks is None:
            self.callbacks = []
        self._active_tags = {}

        self.queues = [queue(self.channel)
                            for queue in maybe_list(self.queues)]

        if self.auto_declare:
            self.declare()
Esempio n. 3
0
    def __init__(self,
                 channel,
                 queues,
                 no_ack=None,
                 auto_declare=None,
                 callbacks=None,
                 on_decode_error=None):
        from kombu.connection import BrokerConnection
        if isinstance(channel, BrokerConnection):
            channel = channel.default_channel
        self.channel = channel
        self.connection = self.channel.connection.client

        self.queues = queues
        if no_ack is not None:
            self.no_ack = no_ack
        if auto_declare is not None:
            self.auto_declare = auto_declare
        if on_decode_error is not None:
            self.on_decode_error = on_decode_error

        if callbacks is not None:
            self.callbacks = callbacks
        if self.callbacks is None:
            self.callbacks = []
        self._active_tags = {}

        self.queues = [
            queue(self.channel) for queue in maybe_list(self.queues)
        ]

        if self.auto_declare:
            self.declare()
Esempio n. 4
0
    def __init__(self, channel, bindings, no_ack=None, auto_declare=None,
            callbacks=None):
        self.channel = channel
        self.bindings = bindings
        if no_ack is not None:
            self.no_ack = no_ack
        if auto_declare is not None:
            self.auto_declare = auto_declare

        if callbacks is not None:
            self.callbacks = callbacks
        if self.callbacks is None:
            self.callbacks = []
        self._active_tags = {}

        self.bindings = [binding(self.channel)
                            for binding in maybe_list(self.bindings)]

        if self.auto_declare:
            self.declare()
Esempio n. 5
0
    def __init__(self, channel, queues, no_ack=None, auto_declare=None,
            callbacks=None, on_decode_error=None):
        self.channel = channel
        self.queues = queues
        if no_ack is not None:
            self.no_ack = no_ack
        if auto_declare is not None:
            self.auto_declare = auto_declare
        if on_decode_error is not None:
            self.on_decode_error = on_decode_error

        if callbacks is not None:
            self.callbacks = callbacks
        if self.callbacks is None:
            self.callbacks = []
        self._active_tags = {}

        self.queues = [queue(self.channel)
                            for queue in maybe_list(self.queues)]

        if self.auto_declare:
            self.declare()
Esempio n. 6
0
 def test_maybe_list(self):
     self.assertEqual(utils.maybe_list(None), [])
     self.assertEqual(utils.maybe_list(1), [1])
     self.assertEqual(utils.maybe_list([1, 2, 3]), [1, 2, 3])
Esempio n. 7
0
 def test_maybe_list(self):
     self.assertEqual(utils.maybe_list(None), [])
     self.assertEqual(utils.maybe_list(1), [1])
     self.assertEqual(utils.maybe_list([1, 2, 3]), [1, 2, 3])