Trait ProgressStore

Source
pub trait ProgressStore: Send {
    type Error: Debug + Display;

    // Required methods
    fn load<'life0, 'async_trait>(
        &'life0 mut self,
        task_name: String,
    ) -> Pin<Box<dyn Future<Output = Result<CheckpointSequenceNumber, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save<'life0, 'async_trait>(
        &'life0 mut self,
        task_name: String,
        checkpoint_number: CheckpointSequenceNumber,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait defining the interface for persistent storage of checkpoint progress.

This trait allows for loading and saving the progress of a task, represented by a task_name & CheckpointSequenceNumber as key value pairs. Implementations of this trait are responsible for persisting this progress across restarts or failures.

Required Associated Types§

Required Methods§

Source

fn load<'life0, 'async_trait>( &'life0 mut self, task_name: String, ) -> Pin<Box<dyn Future<Output = Result<CheckpointSequenceNumber, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loads the last saved checkpoint sequence number for a given task.

Source

fn save<'life0, 'async_trait>( &'life0 mut self, task_name: String, checkpoint_number: CheckpointSequenceNumber, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Saves the current checkpoint sequence number for a given task.

Implementors§