def __init__(self, topics=[], parent=None, name=None): self.parent = parent self.listeners = [] self.topics = [] self.name = __name__ if name is None else name self.participants = {} self.log = Log(self.name, self.do_log) if parent: parent.register(self, topics) return self.connection, self.exchange = messaging.open_connection() self.channel = self.connection.channel() self.channel.exchange_declare(exchange=self.exchange, type="direct") self.sender = Sender(self.channel, self.exchange) if len(topics) == 0: return self.register(topics=topics)