pass
def _schedule_tasks(self):
- """
- @rtype: bool
- @returns: True if there may be remaining tasks to schedule,
- False otherwise.
- """
if self._terminated_tasks:
- return False
+ return
while self._can_add_job():
try:
metadata_process = next(self._process_iter)
except StopIteration:
self._remaining_tasks = False
- return False
+ return
self._jobs += 1
self._running_tasks.add(metadata_process)
metadata_process.scheduler = self.sched_iface
metadata_process.addExitListener(self._metadata_exit)
metadata_process.start()
- return True
def _metadata_exit(self, metadata_process):
self._jobs -= 1
"""
raise NotImplementedError()
+ def _keep_scheduling(self):
+ """
+ @rtype: bool
+ @returns: True if there may be remaining tasks to schedule,
+ False otherwise.
+ """
+ return False
+
def _schedule_tasks(self):
"""
This is called from inside the _schedule() method, which
Unless this method is used to perform user interface updates,
or something like that, the first thing it should do is check
the state of _terminated_tasks and if that is True then it
- should return False immediately (since there's no need to
+ should return immediately (since there's no need to
schedule anything after _terminate_tasks() has been called).
"""
pass
self._terminated_tasks = True
self._terminate_tasks()
- return self._schedule_tasks()
+ self._schedule_tasks()
finally:
self._scheduling = False
while self._is_work_scheduled():
self.sched_iface.iteration()
- def _keep_scheduling(self):
- return False
-
def _is_work_scheduled(self):
return bool(self._running_job_count())