Skip to main content

Crate origin_sync

Crate origin_sync 

Source
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.
SyncContext
Everything a source is given for one run.
SyncEngine
Decides when each registered target runs.
SyncPolicy
When a target should be synchronised.
SyncReport
What one successful sync produced.
SyncStatus
One registered target and how it is doing — the shape the frontend renders.
SyncTarget
One thing that gets synchronised: a kind of data, for one account, at one connector.

Enums§

SyncResult
The outcome a source reports.

Traits§

SyncSource
How a particular kind of data is fetched.

Functions§

health_of
Translate sync bookkeeping into the shared health model.