def __init_broker_and_processors(self): self.__broker = Broker(self) self.__event_processor = EventProcessor(0, self) self.__event_processors = list() for i in range(self.config.processor_num): id = i + 1 event_channel = EventChannel() event_channel.register(self.__broker) event_processor = EventProcessor(id, self, event_channel) self.__event_processors.append(event_processor)
def __init__(self, app): super(Broker, self).__init__() self.__app = app self.__event_channel = EventChannel() self.__running = True self.__registered_channels = dict()