Exemplo n.º 1
0
class Chinook:
	done = False
	upstream = Queue()
	tasks = []

	def __init__(self):
		self.motor = Pink(Queue(), self.upstream, self)
		self.vision = Sockeye(Queue(), self.upstream, self)
		self.misc = Chum(Queue(), self.upstream, self)

	def start(self):
		# Setup task list
		
		self.motor.start()
		self.vision.start()
		self.misc.start()
		self.run()

	def run(self):
		while not self.done:
			if not self.upstream.empty():
				pass # Process data here
			# Make any decisions and send data to threads
			sleep(1)
Exemplo n.º 2
0
	def __init__(self):
		self.motor = Pink(Queue(), self.upstream, self)
		self.vision = Sockeye(Queue(), self.upstream, self)
		self.misc = Chum(Queue(), self.upstream, self)