Create a Scheduler._task_queues attribute which has "build" and "prefetch"
authorZac Medico <zmedico@gentoo.org>
Fri, 4 Jul 2008 07:09:00 +0000 (07:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 4 Jul 2008 07:09:00 +0000 (07:09 -0000)
queues. The build queue is currently unused and the prefetch queue is used
for parallel fetch.

svn path=/main/trunk/; revision=10922

pym/_emerge/__init__.py

index a903e52a6aebdb89f4784191a39be010d56d5a9a..e48aee781e7a233e1f11fb78dc0847ade95f9d4f 100644 (file)
@@ -7113,10 +7113,12 @@ class Scheduler(object):
                except AttributeError:
                        self._poll = PollSelectFallback()
 
-               self._prefetch_queue = SequentialTaskQueue()
-               self._add_task = self._prefetch_queue.add
-               self._schedule_tasks = self._prefetch_queue.schedule
+               self._task_queues = slot_dict_class(("build", "prefetch"), prefix="")
+               for k in self._task_queues.allowed_keys:
+                       setattr(self._task_queues, k, SequentialTaskQueue())
 
+               self._add_task = self._task_queues.prefetch.add
+               self._schedule_tasks = self._task_queues.prefetch.schedule
                self._prefetchers = weakref.WeakValueDictionary()
                self._failed_fetches = []
                self._parallel_fetch = False
@@ -7422,7 +7424,7 @@ class Scheduler(object):
                                        return e.status
                finally:
                        # clean up child process if necessary
-                       self._prefetch_queue.clear()
+                       self._task_queues.prefetch.clear()
                return os.EX_OK
 
        def _save_resume_list(self):