Ejemplo n.º 1
0
	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')
Ejemplo n.º 2
0
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()