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

def calibre::utils::threadpool::ThreadPool::poll (   self,
  block = False 

Process any new results in the queue.

Definition at line 199 of file threadpool.py.

00199                                :
        """Process any new results in the queue."""

        while True:
            # still results pending?
            if not self.workRequests:
                raise NoResultsPending
            # are there still workers to process remaining requests?
            elif block and not self.workers:
                raise NoWorkersAvailable
                # get back next results
                request, result = self.resultsQueue.get(block=block)
                # has an exception occured?
                if request.exception and request.exc_callback:
                    request.exc_callback(request, result)
                # hand results to callback, if any
                if request.callback and not \
                  (request.exception and request.exc_callback):
                    request.callback(request, result)
                del self.workRequests[request.requestID]
            except Queue.Empty:

    def wait(self, sleep=0):

Generated by  Doxygen 1.6.0   Back to index