EventLogNonTrimableTracker

Trait EventLogNonTrimableTracker 

Source
pub trait EventLogNonTrimableTracker {
    // Required methods
    fn store<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        dbtx: &'life1 mut DatabaseTransaction<'_, NonCommittable>,
        pos: EventLogId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        dbtx: &'life1 mut DatabaseTransaction<'_, NonCommittable>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<EventLogId>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Persistent tracker of a position in the event log

During processing of event log the downstream consumer needs to keep track of which event were processed already. It needs to do it atomically and persist it so event in the presence of crashes no event is ever missed or processed twice.

This trait allows abstracting away where and how is such position stored, e.g. which key exactly is used, in what prefixed namespace etc.

§Trimmable vs Non-Trimable log

See EventPersistence

Required Methods§

Source

fn store<'life0, 'life1, 'async_trait>( &'life0 mut self, dbtx: &'life1 mut DatabaseTransaction<'_, NonCommittable>, pos: EventLogId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 mut self, dbtx: &'life1 mut DatabaseTransaction<'_, NonCommittable>, ) -> Pin<Box<dyn Future<Output = Result<Option<EventLogId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load the last previous stored position (or None if never stored)

Implementors§