Logo Search packages:      
Sourcecode: calibre version File versions  Download package

def calibre::utils::threadpool::WorkerThread::run (   self  ) 

Repeatedly process the job queue until told to exit.

Definition at line 83 of file threadpool.py.

00083                  :
        """Repeatedly process the job queue until told to exit."""

        while not self._dismissed.isSet():
            # thread blocks here, if queue empty
            request = self.workRequestQueue.get()
            if self._dismissed.isSet():
                # if told to exit, return the work request we just picked up
                self.workRequestQueue.put(request)
                break # and exit
            try:
                self.resultQueue.put(
                    (request, request.callable(*request.args, **request.kwds))
                )
            except:
                request.exception = True
                import traceback
                self.resultQueue.put((request, traceback.format_exc()))

    def dismiss(self):


Generated by  Doxygen 1.6.0   Back to index