class Aleph (object): """ Sets up and manages the configuration of the reactor. """ def __init__ (self, config): # Setup logging self.log = getlog(self) self.log.info("Initialising") #: The top-level configuration dictionary self.config = config # The dispatcher recives the events generated by the reactor self.dispatcher = Dispatcher(self.config['modules']) self.reactor = Reactor(self.config, self.config.pop('connections')) def start (self): """ Tick until stopped """ self.reactor.set_callback(self.dispatcher) self.reactor.loop()
def __init__ (self, config): # Setup logging self.log = getlog(self) self.log.info("Initialising") #: The top-level configuration dictionary self.config = config # The dispatcher recives the events generated by the reactor self.dispatcher = Dispatcher(self.config['modules']) self.reactor = Reactor(self.config, self.config.pop('connections'))