Expand description
In-memory SyncRegistry keyed by user_id.
The registry is the optimistic layer of the “one running sync per user”
rule (the authoritative layer is the DB query). Insertion is atomic —
two threads racing through try_register will see exactly one win.
Structs§
- Already
Running - Returned by
SyncRegistry::try_registerwhen the user already has a running sync. Carries a snapshot of the existing run so the caller can build the 409 conflict response. - Running
Sync - One in-flight sync. Stored behind an
Arcsosnapshot_fordoes not need the entire entry to live across the call. - Running
Sync Snapshot - Read-only snapshot of a running sync, used by handlers and conflict responses.
- Sync
Registry - In-memory registry:
user_id → RunningSync.