Learn R Programming

automerge (version 0.3.0)

am_sync_state: Create a new sync state

Description

Creates a new synchronization state for managing communication with a peer. The sync state tracks what changes have been sent and received, enabling efficient incremental synchronization.

Usage

am_sync_state()

Arguments

Value

An external pointer to the sync state with class "am_syncstate".

Details

IMPORTANT: Sync state is document-independent. The same sync state is used across multiple sync message exchanges with a specific peer. The document is passed separately to am_sync_encode() and am_sync_decode().

Examples

Run this code
# Create two documents
doc1 <- am_create()
doc2 <- am_create()

# Create sync states for each peer
sync1 <- am_sync_state()
sync1
sync2 <- am_sync_state()

# Use with am_sync_encode() and am_sync_decode()

am_close(doc1)
am_close(doc2)

Run the code above in your browser using DataLab