Logo Search packages:      
Sourcecode: yum-utils version File versions  Download package

def fastestmirror::FastestMirror::_poll_mirrors (   self ) [private]
This function uses L{PollThread} class to ping/poll individual mirror
in parallel.

This function refers:
    - L{PollThread.run()}

This function is referred by:
    - L{FastestMirror.get_mirrorlist()}

Definition at line 357 of file fastestmirror.py.

                           :
        """
        This function uses L{PollThread} class to ping/poll individual mirror
        in parallel.

        This function refers:
            - L{PollThread.run()}

        This function is referred by:
            - L{FastestMirror.get_mirrorlist()}
        """
        global maxthreads
        for mirror in self.mirrorlist:
            if len(self.threads) > maxthreads:
                if self.threads[0].isAlive():
                    self.threads[0].join()
                del self.threads[0]

            if mirror.startswith("file:"):
                mhost = "127.0.0.1"
            else:
                mhost = host(mirror)

            if mhost in timedhosts:
                result = timedhosts[mhost]
                if verbose:
                    print "%s already timed: %s" % (mhost, result)
                self._add_result(mirror, mhost, result)
            elif mhost in ("127.0.0.1", "::1", "localhost", prefer):
                self._add_result(mirror, mhost, 0)
            else:
                # No cached info. so spawn a thread and find the info. out
                self._init_lock()
                pollThread = PollThread(self, mirror)
                pollThread.start()
                self.threads.append(pollThread)
        while len(self.threads) > 0:
            if self.threads[0].isAlive():
                self.threads[0].join()
            del self.threads[0]


Generated by  Doxygen 1.6.0   Back to index