def __init__(self): logger.info('System starting') self.state = State() self.task_scheduler = TaskScheduler() self.router = Router() self.condition_engine = ConditionEngine() self.router.init(self.state, self.condition_engine) self.task_scheduler.init(self.condition_engine) self.condition_engine.init(self, self.state, self.router, self.task_scheduler) logger.info('System started successfully')
class System: def __init__(self): logger.info('System starting') self.state = State() self.task_scheduler = TaskScheduler() self.router = Router() self.condition_engine = ConditionEngine() self.router.init(self.state, self.condition_engine) self.task_scheduler.init(self.condition_engine) self.condition_engine.init(self, self.state, self.router, self.task_scheduler) logger.info('System started successfully') def stop(self): logger.info('Stopping system') self.router.stop() self.task_scheduler.stop() self.condition_engine.stop() logger.info('System stopped successfully') def send(self, node_label, message): if 'stop' in message: self.stop()