Skip to main content

Module sync

Module sync 

Source
Expand description

Replication, from the app server’s side.

One Replica per synced workspace, registered with the bridge, driven by announcements from it and by local edits.

See docs/superpowers/specs/2026-09-16-process-architecture-design.md §4.2.

Re-exports§

pub use id::SYNC_ID_FILE;
pub use id::WORKSPACE_MAP_FILE;
pub use id::sync_id;
pub use id::sync_id_path;

Modules§

id
A workspace’s identity across devices.

Structs§

BackfillTiming
How the primary device paces its backfill (#188).
BridgeConnector
How a SyncRuntime reaches the bridge, on start and whenever it has lost it (#244).
PeerInfo
What SyncRuntime::peers answers with. One device of the workgroup.
PeersResult
What SyncRuntime::peers answers with. Result of PEERS.
SyncRuntime
Replication for one application’s workspaces.
SyncStatus
What sync.status reports.
Watcher
Watches workspace roots and reports which one changed.

Constants§

DEBOUNCE
How long events are coalesced before a root is reported.
DIAL_BACKOFF_MAX
The longest the dialer stays away from a peer that keeps refusing.
OPEN_TIMEOUT
How long a dial waits for the bridge to open a stream to a peer.
RECONNECT_BACKOFF
How long SyncRuntime::keep_connected waits before its first retry after the bridge could not be reached. Each failure doubles it, up to RECONNECT_BACKOFF_MAX.
RECONNECT_BACKOFF_MAX
The longest SyncRuntime::keep_connected waits between two attempts to reach the bridge: a bridge that comes up is found within this long.

Functions§

sync_router
Add sync.enable, sync.disable, sync.map and sync.status to router.