class _sched_iface_class(SlotObject):
__slots__ = ("register", "schedule", "unregister")
- def __init__(self, poll=None):
+ def __init__(self):
self._max_jobs = 1
self._max_load = None
self._jobs = 0
self._poll_event_handler_ids = {}
# Increment id for each new handler.
self._event_handler_id = 0
- if poll is None:
- poll = create_poll_instance()
- self._poll = poll
+ self._poll = create_poll_instance()
self._scheduling = False
def _schedule(self):
run() method returns when no tasks remain.
"""
- def __init__(self, max_jobs=None, max_load=None, poll=None):
- PollScheduler.__init__(self, poll=poll)
+ def __init__(self, max_jobs=None, max_load=None):
+ PollScheduler.__init__(self)
if max_jobs is None:
max_jobs = 1
add tasks and call run(). The run() method returns when no tasks remain.
"""
- def __init__(self, max_jobs=None, max_load=None, poll=None):
+ def __init__(self, max_jobs=None, max_load=None):
self._queue = SequentialTaskQueue(max_jobs=max_jobs)
self._scheduler = QueueScheduler(
- max_jobs=max_jobs, max_load=max_load, poll=poll)
+ max_jobs=max_jobs, max_load=max_load)
self.sched_iface = self._scheduler.sched_iface
self.run = self._scheduler.run
self._scheduler.add(self._queue)