Expand description
§AI Batch Queue
Model-aware batch processing queue with ETA estimation for Tauri applications.
§Key Features
- Resource-aware reordering — automatically groups jobs by resource key (e.g. model name) to minimize expensive swaps
- Size-bucketed ETA estimation — tracks processing durations by (resource, operation, size) for accurate time predictions
- Item-level status tracking — each item has its own lifecycle
- Overwrite policies — skip items that already have results
- Progressive completion with retry — failed items can be retried without re-processing successful ones
- Trace context propagation — optional
stack-idsTraceCtx,AttemptId, andTrialIdon each batch item for cross-crate observability and retry lineage tracking
§Quick Start
- Define your item data type
- Implement
BatchItemHandlerfor your processing logic - Create a
BatchQueueand register it in Tauri state - Call
executor::spawn()to start the background processor
Re-exports§
pub use queue::BatchQueue;pub use types::BatchCompletionSummary;pub use types::BatchItem;pub use types::BatchItemStatus;pub use types::BatchJob;pub use types::BatchJobStatus;pub use types::EtaConfidence;pub use types::EtaEstimate;pub use types::ItemResult;pub use types::OverwritePolicy;pub use types::SchedulingConfig;pub use types::SizeBucket;
Modules§
Traits§
- Batch
Item Handler - Trait for processing individual items in a batch.
- Batch
Store - Trait for persisting batch queue state.
Functions§
- build_
job - Helper to build a
BatchJobfrom a list of items. - build_
job_ traced - Helper to build a
BatchJobwith trace context propagation.