This avoids a case where the first prefetcher is discarded, causing
the second prefetcher to occupy the fetch queue before the first
fetcher has an opportunity to execute.
self._task_queues.fetch.add(prefetcher)
prefetchers[pkg] = prefetcher
+ # Start the first prefetcher immediately so that self._task()
+ # won't discard it. This avoids a case where the first
+ # prefetcher is discarded, causing the second prefetcher to
+ # occupy the fetch queue before the first fetcher has an
+ # opportunity to execute.
+ self._task_queues.fetch.schedule()
+
def _create_prefetcher(self, pkg):
"""
@return: a prefetcher, or None if not applicable