Skip to main content

ThreadStore

Trait ThreadStore 

Source
pub trait ThreadStore: Send + Sync {
    // Required methods
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 ThreadKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ThreadRecord>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn commit<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 ThreadKey,
        expected: Revision,
        transition: ThreadCommit,
    ) -> Pin<Box<dyn Future<Output = Result<CommitOutcome, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Atomic thread state repository.

Required Methods§

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 ThreadKey, ) -> Pin<Box<dyn Future<Output = Result<Option<ThreadRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads the current thread record.

Source

fn commit<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 ThreadKey, expected: Revision, transition: ThreadCommit, ) -> Pin<Box<dyn Future<Output = Result<CommitOutcome, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Commits a checkpoint and its optional durable event if expected and the fencing token are current.

Distributed implementations must validate fencing_token against the authoritative lease, so a paused former owner cannot commit after a new owner acquires the thread.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§