code: def _run_forever(self):
          
          while True:
              try:
                  tick = time.time()
  
                  asyncore.loop(timeout=self.POLL_TIMEOUT, use_poll=True)
  
                  # Sleep for remaining poll cycle time
                  tick += self.POLL_TIMEOUT - time.time()
                  if tick > 0:
                      # wait POLL_TIMEOUT at most (robust against time shifts)
                      time.sleep(min(tick, self.POLL_TIMEOUT))
              except KeyboardInterrupt as exc:
                  self.LOG.info("Termination request received (%s)" % exc)
                  break
              except SystemExit as exc:
                  self.return_code = exc.code or 0
                  self.LOG.info("System exit (RC=%r)" % self.return_code)
                  break
              else:
                  # Idle work
                  #self.LOG.warn("IDLE %s %r" % (self.options.guard_file, os.path.exists(self.options.guard_file)))
                  if self.options.guard_file and not os.path.exists(self.options.guard_file):
                      self.LOG.warn("Guard file '%s' disappeared, exiting!" % self.options.guard_file)
                      break
docs: Run configured jobs until termination request.