class RabbitMessageBase: """Base class for all RabbitMQ messaging.""" def __init__(self, session): self.session = IMessageSession(session) self._channel = None @property def channel(self): if self._channel is None or not self._channel.is_open: connection = self.session.connect() self._channel = connection.channel() self._channel.exchange_declare( self.session.exchange, "direct", durable=False, auto_delete=False, nowait=False) return self._channel
class RabbitMessageBase: """Base class for all RabbitMQ messaging.""" def __init__(self, session): self.session = IMessageSession(session) self._channel = None @property def channel(self): if self._channel is None or not self._channel.is_open: connection = self.session.connect() self._channel = connection.channel() self._channel.exchange_declare(self.session.exchange, "direct", durable=False, auto_delete=False, nowait=False) return self._channel
def __init__(self, session): self.session = IMessageSession(session) self._channel = None