Skip to main content

Crate taskmill

Crate taskmill 

Source
Expand description

§Taskmill

Adaptive priority work scheduler with IO-aware concurrency and SQLite persistence.

Taskmill provides a generic task scheduling system that:

  • Persists tasks to SQLite so the queue survives restarts
  • Schedules by priority (0 = highest, 255 = lowest) with named tiers
  • Deduplicates tasks by key — submitting an already-queued key is a no-op
  • Tracks expected and actual IO bytes per task for budget-based scheduling
  • Monitors system CPU and disk throughput to adjust concurrency
  • Supports composable backpressure from arbitrary external sources
  • Preempts lower-priority work when high-priority tasks arrive
  • Retries failed tasks at the same priority level
  • Records completed/failed task history for queries and IO learning
  • Emits lifecycle events including progress for UI integration (via broadcast channel)
  • Supports graceful shutdown with configurable drain timeout

§Feature flags

  • sysinfo-monitor (default): Enables the built-in SysinfoSampler for cross-platform CPU and disk IO monitoring. Disable for mobile targets or when providing a custom ResourceSampler.

Re-exports§

pub use backpressure::CompositePressure;
pub use backpressure::PressureSource;
pub use backpressure::ThrottlePolicy;
pub use priority::Priority;
pub use registry::StateMap;
pub use registry::TaskContext;
pub use registry::TaskExecutor;
pub use resource::sampler::SamplerConfig;
pub use resource::sampler::SmoothedReader;
pub use resource::ResourceReader;
pub use resource::ResourceSampler;
pub use resource::ResourceSnapshot;
pub use scheduler::EstimatedProgress;
pub use scheduler::ProgressReporter;
pub use scheduler::Scheduler;
pub use scheduler::SchedulerBuilder;
pub use scheduler::SchedulerConfig;
pub use scheduler::SchedulerEvent;
pub use scheduler::SchedulerSnapshot;
pub use scheduler::ShutdownMode;
pub use store::RetentionPolicy;
pub use store::StoreConfig;
pub use store::StoreError;
pub use store::TaskStore;
pub use task::generate_dedup_key;
pub use task::HistoryStatus;
pub use task::SubmitOutcome;
pub use task::TaskError;
pub use task::TaskHistoryRecord;
pub use task::TaskLookup;
pub use task::TaskRecord;
pub use task::TaskResult;
pub use task::TaskStatus;
pub use task::TaskSubmission;
pub use task::TypeStats;
pub use task::TypedTask;
pub use resource::platform_sampler;

Modules§

backpressure
priority
registry
resource
scheduler
store
task