Taskmill
Adaptive priority work scheduler with IO-aware concurrency and SQLite persistence.
Taskmill is an async task queue for Rust applications that persists work to SQLite, schedules by priority with IO-budget awareness, and supports preemption, retries, and composable backpressure. Designed for desktop apps (Tauri, etc.) and background services where tasks have measurable IO costs and the system needs to avoid saturating disk throughput.
Quick example
use Arc;
use Duration;
use CancellationToken;
use ;
;
async
Shared scheduler (library embedding)
A single Scheduler can be shared across an application and any libraries it embeds.
Multiple state types can coexist — each is keyed by its concrete TypeId, and new state
can be injected after the scheduler is built via register_state.
use Arc;
use Scheduler;
// The host app builds the scheduler and registers its own executors.
let scheduler = builder
.store_path
.executor
.app_state
.max_concurrency
.build
.await
.unwrap;
// A library can inject its own state after build.
scheduler.register_state.await;
// Both the host and the library submit tasks to the same queue.
// The host manages the run loop.
let token = new;
scheduler.run.await;
Features
- SQLite persistence — tasks survive restarts; crash recovery requeues interrupted work
- 256-level priority queue — with preemption of lower-priority tasks
- IO-aware scheduling — defers work when disk throughput is saturated
- Key-based deduplication — SHA-256 keys prevent duplicate submissions
- Composable backpressure — plug in external pressure signals with custom throttle policies
- Cross-platform resource monitoring — CPU and disk IO via
sysinfo(Linux, macOS, Windows) - Retries — automatic requeue of retryable failures with configurable limits
- Progress reporting — executor-reported and throughput-extrapolated progress
- Lifecycle events — broadcast events for UI integration (Tauri, etc.)
- Typed payloads — serialize/deserialize structured task data
- Batch submission — bulk enqueue in a single SQLite transaction
- Graceful shutdown — configurable drain timeout before force-cancellation
- Global pause/resume — pause all work when the app is backgrounded
- Type-keyed application state — register multiple state types, inject pre- or post-build
- Clone-friendly —
SchedulerisCloneviaArcfor easy sharing - Serde on all public types — ready for Tauri IPC
For a detailed breakdown of every feature, see docs/features.md.
Documentation
| Guide | Description |
|---|---|
| Quick Start | Installation, first executor, builder setup, and running the scheduler |
| Features | Complete feature list with descriptions |
| Priorities & Preemption | Priority levels, preemption mechanics, and throttle behavior |
| IO Tracking & Backpressure | IO budgets, resource monitoring, pressure sources, and throttle policies |
| Persistence & Recovery | SQLite schema, crash recovery, deduplication, and history retention |
| Progress Reporting | Executor progress, extrapolation, dashboard snapshots, and lifecycle events |
| Configuration | All configuration options for scheduler, store, sampler, and feature flags |
| Query APIs | Full TaskStore query reference for dashboards and debugging |
License
MIT