Skip to main content

SessionCheckpointer

Trait SessionCheckpointer 

Source
pub trait SessionCheckpointer: Send + Sync {
    // Required method
    fn checkpoint<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session: &'life1 Session,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Periodic session persistence hook.

Implementations clone what they need from the borrowed Session. Errors are logged, not propagated — a checkpoint failure should not kill the agent loop.

Required Methods§

Source

fn checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 Session, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a snapshot of the current session state.

Implementors§