pub struct Engine { /* private fields */ }Expand description
Drives changes from a source through to a sink.
Implementations§
Source§impl Engine
impl Engine
pub fn new( source: Arc<dyn ChangeCapture>, documents: Arc<dyn DocumentBuilder>, sink: Arc<dyn Sink>, ) -> Self
Sourcepub fn with_observer(self, observer: Arc<dyn Observer>) -> Self
pub fn with_observer(self, observer: Arc<dyn Observer>) -> Self
Report lifecycle and progress events to observer (metrics, a live
status surface, …). Defaults to NoopObserver. See Observer.
Sourcepub fn with_queue_capacity(self, capacity: usize) -> Self
pub fn with_queue_capacity(self, capacity: usize) -> Self
Set how many changes may buffer between capture and the worker.
Sourcepub fn with_batch(self, batch: BatchPolicy) -> Self
pub fn with_batch(self, batch: BatchPolicy) -> Self
Set how the worker groups changes into one sink flush (see
BatchPolicy). max_changes is clamped to at least 1.
Sourcepub fn skip_backfill(self, skip: bool) -> Self
pub fn skip_backfill(self, skip: bool) -> Self
Force-skip the backfill phase entirely, regardless of what the sink reports. An escape hatch for sinks that can’t persist seeded-state (so they would otherwise re-seed every run) or to resume without re-checking.
Sourcepub fn with_failure_policies(self, policies: FailurePolicies) -> Self
pub fn with_failure_policies(self, policies: FailurePolicies) -> Self
Set how the engine resolves the policy for documents a sink rejects at
the item level (see FailurePolicies). Defaults to
FailurePolicy::Stop for every index.
Sourcepub async fn run(self) -> Result<()>
pub async fn run(self) -> Result<()>
Run until the live change stream ends or an error stops the pipeline.
First seeds any unseeded index (unless skip_backfill
is set), then follows live changes.