def shutdown(self): AmqpDaemon.shutdown(self) #log.info('Shutdown called') #self._shutdown = True # Send an action message to ourself to make sure # we break out of the wait-loop for actions asap. #log.info('Send _shutdown action') #self.sendShutdownAction() #log.info('Wait 0.5') time.sleep(0.5) log.info('Joining actionThread') if self.actionThread: try: self.actionThread.join() except RuntimeError, e: log.warn('Ignoring exception about joining actionThread: %s' % e)
def __init__(self, id): log.info('Starting manager') AmqpDaemon.__init__(self, 'manager', id)
def __init__(self, config): AmqpDaemon.__init__(self, 'service', config.get('id')) #, sendHeartBeat=True) self.config = config self.eventThread = None self.actionThread = None self.onInit()
def sendEvent(self, key, data, deviceAttributes=None): AmqpDaemon.sendEvent(self, key, data, deviceAttributes)
def sendEvent(self, key, data, deviceAttributes={}): # add the service class to all events from that class deviceAttributes['class'] = self.config.get('class') AmqpDaemon.sendEvent(self, key, data, deviceAttributes)