swh.scheduler.simulator.task_scheduler module#

Agents using the “old” task-based scheduler.

swh.scheduler.simulator.task_scheduler.scheduler_runner_process(env: Environment, task_queues: Dict[str, Queue], min_batch_size: int) Iterator[Event][source]#

Simulate a scheduler runner process. This schedules tasks from the database according to the scheduling policy, that means filling the task_queues first, then update their status in the scheduler backend.

swh.scheduler.simulator.task_scheduler.scheduler_listener_process(env: Environment, status_queue: Queue) Generator[Event, TaskEvent, None][source]#

Scheduler listener. In the real world this would listen to celery events, but we listen to the status_queue and simulate celery events from that.