Skip to main content

Module scheduler

Module scheduler 

Source
Expand description

The scheduler: core types, configuration, and the main run loop.

Scheduler coordinates task execution — popping from the TaskStore, applying backpressure, IO-budget checks, and group concurrency limits, preempting lower-priority work, and emitting SchedulerEvents for UI integration. Use SchedulerBuilder for ergonomic construction.

The Scheduler implementation is split across focused submodules:

  • submit — task submission, lookup, cancellation, and superseding
  • run_loop — the main event loop, dispatch, and shutdown
  • control — pause/resume, concurrency limits, and group limits
  • queries — read-only queries (active tasks, progress, snapshots)
  • builder — ergonomic construction via SchedulerBuilder
  • dispatch — task spawning, active-task tracking, and preemption
  • gate — admission control (IO budget, backpressure, group limits)
  • event — event types and scheduler configuration
  • progress — progress reporting, byte-level tracking, and extrapolation

See the crate-level docs for a full walkthrough of the task lifecycle, common patterns, and how the dispatch loop works.

Re-exports§

pub use progress::EstimatedProgress;
pub use progress::ProgressReporter;
pub use progress::TaskProgress;

Modules§

progress
Progress reporting, byte-level transfer tracking, and throughput-based extrapolation.

Structs§

GroupLimits
Per-group concurrency limits for task dispatch.
Scheduler
IO-aware priority scheduler.
SchedulerBuilder
Ergonomic builder for constructing a Scheduler with all its dependencies.
SchedulerConfig
Scheduler configuration.
SchedulerSnapshot
Single-call status snapshot for dashboard UIs.
TaskEventHeader
Common fields shared by task-specific SchedulerEvent variants.

Enums§

SchedulerEvent
Events emitted by the scheduler for UI integration and observability.
ShutdownMode
How the scheduler behaves during shutdown.