Пример #1
0
 def heartbeat(self):
     if self.dead():
         return
     timer.cancelAllByTag(tag=self)
     timer.scheduleIn(timeout=self._HEARTBEAT_TIMEOUT,
                      callback=self._heartbeatTimeout,
                      tag=self)
 def _changeState(self, state):
     timer.cancelAllByTag(tag=self)
     self._state = state
     if state in self.TIMEOUT:
         timer.scheduleIn(timeout=self.TIMEOUT[state], callback=self._timeout, tag=self)
     if self._stateChangeCallback is not None:
         self._stateChangeCallback(self)
Пример #3
0
 def _changeState(self, state):
     timer.cancelAllByTag(tag=self)
     self._state = state
     if state in self._TIMEOUT:
         timer.scheduleIn(timeout=self._TIMEOUT[state],
                          callback=self._timeout,
                          tag=self)
     if self._stateChangeCallback is not None:
         self._stateChangeCallback(self)
 def _inauguratorProgress(self, progress):
     if self._state not in [STATE_INAUGURATION_LABEL_PROVIDED, STATE_CHECKED_IN]:
         logging.error("Progress message in invalid state: %(state)s", dict(state=self._state))
         return
     if self._state == STATE_CHECKED_IN:
         return
     if 'state' not in progress or 'percent' not in progress:
         logging.error("Invalid progress message: %(progress)s", dict(progress=progress))
         return
     if progress['state'] != 'fetching':
         return
     if progress[u'percent'] != self._inaugurationProgressPercent:
         self._inaugurationProgressPercent = progress[u'percent']
         timer.cancelAllByTag(tag=self)
         timer.scheduleIn(timeout=self.TIMEOUT[STATE_INAUGURATION_LABEL_PROVIDED],
                          callback=self._timeout, tag=self)
Пример #5
0
 def heartbeat(self):
     if self.dead():
         return
     timer.cancelAllByTag(tag=self)
     timer.scheduleIn(timeout=self._HEARTBEAT_TIMEOUT, callback=self._heartbeatTimeout, tag=self)