Exemplo n.º 1
0
def start():
	"""
	Starts an archiving producer registered under the specified name.
	
	All records must be defined via addMonitor() calls before starting
	the producer. Updates cannot be send, via update(), until the
	producer has been started.
	"""
	global theArchive
	assert(theArchive is not None)
	assert(not theArchive.started)
	logging.info('Starting archive client')
	theArchive.start()
Exemplo n.º 2
0
def addMonitor(name,channels):
	"""
	Adds a monitor for a new record to this producer.
	
	The producer must be initialized before monitors can be added. No
	monitors can be added after the producer has been started. This
	function does not generate any network traffic itself but, instead,
	queues up the data that will be sent when the producer is started.
	"""
	global theArchive
	assert(theArchive is not None)
	assert(not theArchive.started)
	logging.info('Will monitor "%s" record with %d channels',name,len(channels))
	theArchive.addMonitor(name,channels)
Exemplo n.º 3
0
	def start(self):
		# Our service name should already have been set in the global initialize() function.
		assert(self.service_name is not None)
		# Let the world know we are starting
		logging.info('Starting proxy as %s' % self.service_name)
		# TODO: add a monitor for our state transitions
		#archiving.addMonitor('state',[('value',data.unsigned)])
		# Tell the archiver about the data we provide
		archiving.start()
		# Perform any optional startup configuration
		try:
			sys.modules['__main__'].configure()
		except AttributeError:
			logging.debug('Proxy does not perform any startup configuration')
		# Initialize our state machine
		self.state = self.setState(self)
		logging.info('Started in state %s',self.state.name)
		# Start the main loop (this call never returns)
		twisted.internet.reactor.run()