pub trait SyncEngine: Send + Sync {
type Error: Error + Send + Sync + 'static;
// Required methods
fn sync_once(
&self,
) -> impl Future<Output = Result<SyncResult, Self::Error>> + Send;
fn status(
&self,
) -> impl Future<Output = Result<SyncStatus, Self::Error>> + Send;
}Expand description
Applies CDC events from the OLTP engine to the OLAP engine.
The sync loop (in rhei-sync) calls SyncEngine::sync_once repeatedly
on a configurable interval. A crate::SyncMode controls whether the OLAP
table is kept as a mirror (Destructive) or an append-only temporal store
(Temporal / SCD Type 2).
§Contract for implementors
Required Associated Types§
Required Methods§
Sourcefn sync_once(
&self,
) -> impl Future<Output = Result<SyncResult, Self::Error>> + Send
fn sync_once( &self, ) -> impl Future<Output = Result<SyncResult, Self::Error>> + Send
Poll the CDC log and apply any new events to the OLAP engine.
Returns a SyncResult summarising the work done. If there are no new
events, the result will have all counters set to zero and last_seq = None.
§Errors
Returns Err(Self::Error) if either the CDC consumer or the OLAP engine
encounters an unrecoverable failure.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.