示例#1
0
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()
示例#2
0
	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'))