Ejemplo n.º 1
0
class ArmadaMasterProcessProtocol(ProcessProtocol):
	def __init__(self):
		self.protocol = ArmadaMasterProtocol()
		self.onconnect = Deferred()

	def queueWork(self, finished, function, *args):
		self.protocol.queueWork(finished, function, *args)
		return finished

	def write(self, data):
		self.transport.writeToChild(CHILD_IN, data)

	def connectionMade(self):
		self.protocol.makeConnection(self)
		self.onconnect.callback(self)

	def childDataReceived(self, childFD, data):
		if childFD in (1, 2):
			print data
		if childFD == CHILD_OUT:
			self.protocol.dataReceived(data)

	@property
	def working(self):
		return self.protocol.working
Ejemplo n.º 2
0
	def __init__(self):
		self.protocol = ArmadaMasterProtocol()
		self.onconnect = Deferred()