Skip to main content

origin_sync/
lib.rs

1//! The sync engine.
2//!
3//! The division of labour is the whole point:
4//!
5//! ```text
6//! A SyncSource decides HOW data is fetched.
7//! The engine decides WHEN, and under which conditions.
8//! ```
9//!
10//! Retry, exponential backoff, jitter, offline handling, validators and
11//! single-flight belong to the platform. A connector that implements them itself
12//! implements them differently from the next one, and none of them get tested.
13//!
14//! The engine is deliberately split so that scheduling is testable without waiting:
15//! [`SyncEngine::run_due`] does one pass for a given instant, and the background loop
16//! is a thin wrapper that calls it on a tick.
17
18mod backoff;
19mod engine;
20mod health;
21mod policy;
22mod source;
23mod state_store;
24mod target;
25
26pub use backoff::Backoff;
27pub use engine::SyncEngine;
28pub use health::{SyncStatus, health_of};
29pub use policy::SyncPolicy;
30pub use source::{SyncContext, SyncReport, SyncResult, SyncSource, SyncThrottle};
31pub use target::SyncTarget;