Example #1
0
	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)
		self.sched_iface = self._scheduler.sched_iface
		self.run = self._scheduler.run
		self._scheduler.add(self._queue)
Example #2
0
 def __init__(self, main=True, max_jobs=None, max_load=None):
     self._queue = SequentialTaskQueue(max_jobs=max_jobs)
     self._scheduler = QueueScheduler(main=main,
                                      max_jobs=max_jobs,
                                      max_load=max_load)
     self.sched_iface = self._scheduler.sched_iface
     self.run = self._scheduler.run
     self.clear = self._scheduler.clear
     self.wait = self._queue.wait
     self._scheduler.add(self._queue)
Example #3
0
class TaskScheduler(object):
    """
	A simple way to handle scheduling of AsynchrousTask instances. Simply
	add tasks and call run(). The run() method returns when no tasks remain.
	"""
    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)
        self.sched_iface = self._scheduler.sched_iface
        self.run = self._scheduler.run
        self._scheduler.add(self._queue)

    def add(self, task):
        self._queue.add(task)
Example #4
0
 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)
     self.sched_iface = self._scheduler.sched_iface
     self.run = self._scheduler.run
     self.clear = self._scheduler.clear
     self._scheduler.add(self._queue)
Example #5
0
class TaskScheduler(object):

    """
	A simple way to handle scheduling of AsynchrousTask instances. Simply
	add tasks and call run(). The run() method returns when no tasks remain.
	"""

    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)
        self.sched_iface = self._scheduler.sched_iface
        self.run = self._scheduler.run
        self.clear = self._scheduler.clear
        self._scheduler.add(self._queue)

    def add(self, task):
        self._queue.add(task)