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§
sourcefn 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 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()
.
sourcefn 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 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.
sourcefn read_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,
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()
.