# Unknown problem in the library. Report this and continue.
excinfo=sys.exc_info()
print"ERROR during processing of incoming message."
traceback.print_exception(*excinfo)
print"Thread %d: Resuming listening on bus %s for service %s"%(index,self.BusName,self.ServiceName)
print("Thread %d STOPPED Listening for messages on Bus %s and service name %s and %d processed."%(index,self.BusName,self.ServiceName,self.counter[index]))
defStopListening(self):
# stop all running threads
if (self.running):
self.running=False
foriinrange(self._numthreads):
self._tr[i].join()
# possibly doubly defined..
if (self.connected):
self.connected=False
if (isinstance(self.Listen,FromBus)):
self.Listen.close()
if (isinstance(self.Reply,ToBus)):
self.Reply.close()
defWaitForInterrupt(self):
looping=True
whilelooping:
try:
time.sleep(100)
except (KeyboardInterrupt):
looping=False
print("Keyboard interrupt received.")
classService:
"""
Service class for registering python functions with a Service name on a messgage bus.