示例#1
0
文件: __init__.py 项目: auduny/chains
 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)
示例#2
0
 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)
示例#3
0
 def __init__(self, id):
     log.info('Starting manager')
     AmqpDaemon.__init__(self, 'manager', id)
示例#4
0
文件: __init__.py 项目: auduny/chains
 def __init__(self, config):
     AmqpDaemon.__init__(self, 'service', config.get('id')) #, sendHeartBeat=True)
     self.config = config
     self.eventThread = None
     self.actionThread = None
     self.onInit()
示例#5
0
文件: __init__.py 项目: auduny/chains
 def sendEvent(self, key, data, deviceAttributes=None):
     AmqpDaemon.sendEvent(self, key, data, deviceAttributes)
示例#6
0
 def __init__(self, config):
     AmqpDaemon.__init__(self, 'service', config.get('id')) #, sendHeartBeat=True)
     self.config = config
     self.eventThread = None
     self.actionThread = None
     self.onInit()
示例#7
0
 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)
示例#8
0
 def __init__(self, id):
     log.info('Starting manager')
     AmqpDaemon.__init__(self, 'manager', id)