def connect(self, exchange, channel): # pragma: no cover
"""
Readies the StorageNotify for publishing notification messages by
setting up a kombu.Producer.
:param exchange: The exchange for publishing notifications.
:type exchange: kombu.Exchange
:param channel: The channel to bind to.
:type channel: kombu.transport.base.StdChannel
"""
name = self.__class__.__name__
self.logger.debug('Connecting {}'.format(name))
self._queue = kombu.Queue(exchange=exchange, channel=channel)
self._queue.declare()
self._producer = kombu.Producer(channel, exchange)
评论列表
文章目录