parameters: (self)
docstring: Repeatedly process the job queue until told to exit.
docstring_summary: Repeatedly process the job queue until told to exit.
docstring_tokens: Repeatedly process the job queue until told to exit .
function: def run(self):
          """Repeatedly process the job queue until told to exit."""
          while True:
              if self._dismissed.isSet():
                  # we are dismissed, break out of loop
                  break
              # get next work request. If we don't get a new request from the
              # queue after self._poll_timout seconds, we jump to the start of
              # the while loop again, to give the thread a chance to exit.
              try:
                  request = self._requests_queue.get(True, self._poll_timeout)
              except Queue.Empty:
                  continue
              else:
                  if self._dismissed.isSet():
                      # we are dismissed, put back request in queue and exit loop
                      self._requests_queue.put(request)
                      break
                  try:
                      result = request.callable(*request.args, **request.kwds)
                      self._results_queue.put((request, result))
                  except:
                      request.exception = True
                      self._results_queue.put((request, sys.exc_info()))
function_tokens: def run ( self ) : while True : if self . _dismissed . isSet ( ) : # we are dismissed, break out of loop break # get next work request. If we don't get a new request from the # queue after self._poll_timout seconds, we jump to the start of # the while loop again, to give the thread a chance to exit. try : request = self . _requests_queue . get ( True , self . _poll_timeout ) except Queue . Empty : continue else : if self . _dismissed . isSet ( ) : # we are dismissed, put back request in queue and exit loop self . _requests_queue . put ( request ) break try : result = request . callable ( * request . args , * * request . kwds ) self . _results_queue . put ( ( request , result ) ) except : request . exception = True self . _results_queue . put ( ( request , sys . exc_info ( ) ) )