Skip to main content

Crate agent_queue

Crate agent_queue 

Source
Expand description

§Job Queue

Production-grade background agent job queue system extracted from tauri-queue. Framework-agnostic — no Tauri dependency.

§Features

  • Priority-based scheduling (High, Normal, Low)
  • SQLite persistence with crash recovery
  • Hardware throttling (cooldown, max consecutive runs)
  • Real-time cancellation during job execution
  • Progress tracking via pluggable event emitter
  • Pause/resume capability

§Quick Start

  1. Define a job type implementing JobHandler
  2. Create a QueueManager with a QueueConfig
  3. Add jobs with QueueManager::add()
  4. Spawn the executor with QueueManager::spawn()

Re-exports§

pub use config::QueueConfig;
pub use config::QueueConfigBuilder;
pub use error::QueueError;
pub use executor::ProcessedJob;
pub use queue::QueueManager;
pub use types::FailureClass;
pub use types::JobResult;
pub use types::QueueJob;
pub use types::QueueJobDetails;
pub use types::QueueJobStatus;
pub use types::QueuePriority;
pub use types::QueueStats;

Modules§

config
db
error
events
executor
queue
types

Structs§

JobContext
Context provided to job handlers during execution.
LoggingEventEmitter
A logging event emitter that logs events via tracing.
NoopEventEmitter
A no-op event emitter that discards all events.

Traits§

JobHandler
Trait that job types must implement to be processed by the queue.
QueueEventEmitter
Trait for emitting queue lifecycle events.