Skip to main content

Module sync

Module sync 

Source
Expand description

Minimal sync contracts and local implementations.

Structs§

FileReplicationLog
File-backed append-only replication log for local Runtime sync.
FileSyncCheckpointStore
File-backed checkpoint store (line-based peer=sequence,hash).
FileSyncOutbox
Crash-consistent incremental file-backed synchronization outbox.
FollowerSyncClient
Pushes leader events to a follower over transport.
HeartbeatMessage
Transport-neutral heartbeat message.
HttpSyncTransport
Bounded blocking HTTP client for leader-to-follower sync batches.
InMemoryReplicationLog
In-memory replication log for local sync scenarios.
InMemorySyncCheckpointStore
In-memory checkpoint store for tests/local runtime.
InMemorySyncOutbox
Process-local synchronization outbox.
PeerInfo
Peer metadata used by sync orchestration.
ReplicationSnapshot
Integrity-protected portable image of a replication log.
ReplicationSnapshotRecord
Sequence-addressed event stored in a replication snapshot.
SyncEnvelopeV1
Versioned sync envelope carrying the complete distributed source identity.
SyncMessage
Mensagem de replicação enviada do líder para o seguidor.
SyncOutboxReceipt
Bounded acknowledgement for an ordered prefix of the outbox.
SyncOutboxStats
Bounded outbox observations without message payloads.
SyncPeerAddress
Parsed and normalized address of a synchronization peer.
SyncPushMetrics
Basic sync push metrics for local observability.
SyncReceiveAck
Ack returned by /v1/sync/events.
SyncReceiverState
In-memory receiver state for follower sync endpoint.
SyncRetryPolicy
Retry and queue limits for follower push.

Enums§

NodeRole
Node role used by leader election and write routing.
SyncError
Sync-local typed errors.
SyncPeerScheme
HTTP scheme supported by the built-in synchronization transport.
SyncStatus
Coarse sync health and progress status.

Constants§

MAX_CHECKPOINT_FILE_BYTES
Maximum bytes accepted in one checkpoint file.
MAX_CHECKPOINT_PEER_ID_BYTES
Maximum UTF-8 bytes accepted in one checkpoint peer identifier.
MAX_CHECKPOINT_RECORDS
Maximum non-empty records accepted in one checkpoint file.
MAX_OUTBOX_PAGE_BYTES
Maximum encoded message bytes returned by one bounded outbox read.
MAX_OUTBOX_PAGE_MESSAGES
Maximum number of messages returned by one bounded outbox read.
MAX_REPLICATION_PAGE_BYTES
Maximum aggregate payload bytes returned by one replication-log page.
MAX_REPLICATION_PAGE_RECORDS
Maximum records returned by one bounded replication-log page.
MAX_SYNC_BATCH_PAYLOAD_BYTES
Maximum raw event bytes grouped into one Runtime HTTP sync batch.
MAX_SYNC_REQUEST_BODY_BYTES
Maximum encoded V1 sync envelope accepted by the default HTTP transport.
REPLICATION_LOG_FORMAT_V1
Stable on-disk format marker for hash-chained replication logs.
SYNC_CHECKPOINT_FORMAT_V1
Stable on-disk format marker for peer checkpoints.
SYNC_OUTBOX_FORMAT_V2
Stable on-disk format marker for incremental durable sync outboxes. Stable on-disk format marker for incremental durable sync outboxes.
SYNC_SNAPSHOT_FORMAT_V1
Stable format version for portable replication snapshots.
SYNC_WIRE_SCHEMA_V1
Schema identifier for the first identity-aware sync wire envelope.

Traits§

LeaderElection
Leader election contract.
ReplicationLog
Replication log contract.
SyncCheckpointStore
Sync checkpoint storage contract by peer id.
SyncOutbox
Ordered bounded queue that retains replication batches until acknowledgement.
SyncTransport
Sync transport contract.

Functions§

compute_events_hash
Computes the SHA-256 hash of events payload deterministically including size prefixes and batch metadata.
decode_sync_envelope
Decodes the identity-aware v1 JSON envelope.
decode_sync_message
Decodes a versioned v1 envelope and returns its replication message.
discover_dns_sync_peers
Resolves DNS peer seeds and returns normalized, de-duplicated addresses.
encode_sync_envelope_v1
Encodes an identity-aware v1 envelope as JSON.
encoded_sync_message_bytes
Returns the exact compact JSON byte length of a synchronization message.
write_sync_message_json
Writes the compact JSON representation used by SyncMessage serialization.

Type Aliases§

SyncResult
Sync-local result type.