AsyncScheduler: implement _poll
authorZac Medico <zmedico@gentoo.org>
Wed, 3 Oct 2012 18:39:11 +0000 (11:39 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 3 Oct 2012 18:39:11 +0000 (11:39 -0700)
pym/portage/util/_async/AsyncScheduler.py

index a452c0c377996450e79926afe7c27ac880753bec..3fb079c4743319507f4567371cdf2385104651f6 100644 (file)
@@ -25,6 +25,11 @@ class AsyncScheduler(AsynchronousTask, PollScheduler):
                self._term_check_id = None
                self._loadavg_check_id = None
 
+       def _poll(self):
+               if not (self._is_work_scheduled() or self._keep_scheduling()):
+                       self.wait()
+               return self.returncode
+
        def _cancel(self):
                self._terminated.set()
                self._termination_check()