Skip to main content

BatchStore

Trait BatchStore 

Source
pub trait BatchStore<D>: Send + Sync
where D: Clone + Send + Sync + Serialize + DeserializeOwned + 'static,
{ // Required methods fn save_job(&self, job: &BatchJob<D>) -> Result<()>; fn load_all(&self) -> Result<Vec<BatchJob<D>>>; fn delete_job(&self, job_id: &str) -> Result<()>; }
Expand description

Trait for persisting batch queue state.

The default BatchQueue is in-memory only. Implement this trait to persist jobs across restarts (e.g., to SQLite or a file).

Required Methods§

Source

fn save_job(&self, job: &BatchJob<D>) -> Result<()>

Save or update a batch job.

Source

fn load_all(&self) -> Result<Vec<BatchJob<D>>>

Load all jobs (for startup recovery).

Source

fn delete_job(&self, job_id: &str) -> Result<()>

Delete a completed/cancelled job.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§