SyncEngine
class SyncEngine(cursorStore: SyncCursorStore, telemetry: SyncTelemetrySink = NoOpSyncTelemetrySink)
Drives offline, cross-device delta sync for user-owned resources through one generic loop. Resources plug in as SyncResourceAdapters; this engine owns the contract invariants (ack guard, pending guard, full-snapshot tombstone reconciliation, pagination drain, fullResyncRequired), so they hold identically for all resources and a new resource cannot accidentally skip one.
This is a plain, DI-framework-agnostic class: construct it with your own SyncCursorStore and (optionally) a SyncTelemetrySink, and wire it into whatever DI container your app uses.
Functions
Link copied to clipboard
suspend fun syncAll(adapters: List<SyncResourceAdapter<*, *, *, *>>, limit: Int = DEFAULT_LIMIT): Result<Unit>
Runs adapters in sequence under one sync pass. Per-resource isolation: one resource failing does not abort the others; the first failure (if any) is returned once all adapters have been attempted.