code: def handle(self):
          
          while True:
              # TODO: Queue.get() (and anything using thread.allocate_lock
              #       ignores signals :(  so timeout periodically to allow delivery
              try:
                  callable = None # ensure no lingering references to past work while blocking
                  callable = self._Q.get(True, 1.0)
              except Empty:
                  continue  # retry on timeout
              try:
                  if callable is self._stopit:
                      break
                  callable()
              except:
                  _log.exception("Error from WorkQueue")
              finally:
                  self._Q.task_done()
docs: Process queued work until interrupt() is called