(self)
Main method run by the processing threads of the thread pool.
        Loops forever, handling requests read from the connections present in the active_queue
Main method run by the processing threads of the thread pool.
        Loops forever, handling requests read from the connections present in the active_queue
Main method run by the processing threads of the thread pool . Loops forever handling requests read from the connections present in the active_queue
def _serve_clients(self):
        '''Main method run by the processing threads of the thread pool.
        Loops forever, handling requests read from the connections present in the active_queue'''
        while self.active:
            try:
                # note that we do not use a timeout here. This is because the implementation of
                # the timeout version performs badly. So we block forever, and exit by filling
                # the queue with None fds
                fd = self._active_connection_queue.get(True)
                # fd may be None (case where we want to exit the blocking get to close the service)
                if fd:
                    # serve the requests of this connection
                    self._serve_requests(fd)
            except Queue.Empty:
                # we've timed out, let's just retry. We only use the timeout so that this
                # thread can stop even if there is nothing in the queue
                pass
            except Exception:
                ex = sys.exc_info()[1]
                # "Caught exception in Worker thread" message
                self.logger.warning("failed to serve client, caught exception : %s", str(ex))
                # wait a bit so that we do not loop too fast in case of error
                time.sleep(0.2)
def _serve_clients ( self ) : while self . active : try : # note that we do not use a timeout here. This is because the implementation of # the timeout version performs badly. So we block forever, and exit by filling # the queue with None fds fd = self . _active_connection_queue . get ( True ) # fd may be None (case where we want to exit the blocking get to close the service) if fd : # serve the requests of this connection self . _serve_requests ( fd ) except Queue . Empty : # we've timed out, let's just retry. We only use the timeout so that this # thread can stop even if there is nothing in the queue pass except Exception : ex = sys . exc_info ( ) [ 1 ] # "Caught exception in Worker thread" message self . logger . warning ( "failed to serve client, caught exception : %s" , str ( ex ) ) # wait a bit so that we do not loop too fast in case of error time . sleep ( 0.2 )