client.swarm.services.scheduler
Scheduler: Task batching and queueing for workflow runs.
This service manages the scheduling of tasks, including batching tasks with compatible resources and queueing them to the server.
Attributes
Classes
Result of queueing a batch of tasks. |
|
Generates and executes task queue commands. |
Module Contents
- client.swarm.services.scheduler.logger
- class client.swarm.services.scheduler.BatchResult
Result of queueing a batch of tasks.
- class client.swarm.services.scheduler.Scheduler(gateway: jobmon.client.swarm.gateway.ServerGateway, state: jobmon.client.swarm.state.SwarmState)
Generates and executes task queue commands.
The Scheduler is responsible for: - Batching tasks with compatible resources - Respecting workflow and array concurrency limits - Queueing batches to the server - Returning state updates from queue responses
- Usage:
scheduler = Scheduler(gateway=gateway, state=state)
# Single scheduling tick update = await scheduler.tick(timeout=30.0) state.apply_update(update)
Initialize the scheduler.
- Parameters:
gateway – ServerGateway for server communication.
state – SwarmState containing all task/array state (single source of truth).