pub trait ShareableTimestampOracle<T>: Debug {
    // Required methods
    fn write_ts<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = WriteTimestamp<T>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn peek_write_ts<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_ts<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn apply_write<'life0, 'async_trait>(
        &'life0 self,
        lower_bound: T
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A shareable version of TimestampOracle that is Send and Sync.

We have this as a stop-gap solution while we still keep the legacy in-memory/backed-by-catalog TimestampOracle around. Once we remove that we can make TimestampOracle shareable.

Required Methods§

source

fn write_ts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = WriteTimestamp<T>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Acquire a new timestamp for writing.

This timestamp will be strictly greater than all prior values of self.read_ts() and self.write_ts().

source

fn peek_write_ts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Peek the current write timestamp.

source

fn read_ts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Acquire a new timestamp for reading.

This timestamp will be greater or equal to all prior values of self.apply_write(write_ts), and strictly less than all subsequent values of self.write_ts().

source

fn apply_write<'life0, 'async_trait>( &'life0 self, lower_bound: T ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Mark a write at write_ts completed.

All subsequent values of self.read_ts() will be greater or equal to write_ts.

Implementors§