Expand description
The sync engine.
The division of labour is the whole point:
A SyncSource decides HOW data is fetched.
The engine decides WHEN, and under which conditions.Retry, exponential backoff, jitter, offline handling, validators and single-flight belong to the platform. A connector that implements them itself implements them differently from the next one, and none of them get tested.
The engine is deliberately split so that scheduling is testable without waiting:
SyncEngine::run_due does one pass for a given instant, and the background loop
is a thin wrapper that calls it on a tick.
Structs§
- Backoff
- Exponential backoff with a cap and jitter.
- Sync
Context - Everything a source is given for one run.
- Sync
Engine - Decides when each registered target runs.
- Sync
Policy - When a target should be synchronised.
- Sync
Report - What one successful sync produced.
- Sync
Status - One registered target and how it is doing — the shape the frontend renders.
- Sync
Target - One thing that gets synchronised: a kind of data, for one account, at one connector.
- Sync
Throttle - A service-imposed limit on how soon the next run may happen.
Enums§
- Sync
Result - The outcome a source reports.
Traits§
- Sync
Source - How a particular kind of data is fetched.
Functions§
- health_
of - Translate sync bookkeeping into the shared health model.