yorkie-team/yorkie

Add interface to stop synchronization while maintaining realtime sync

hackerwins opened this issue · 1 comments

What would you like to be added:

Currently, Yorkie has the following synchronization modes:

A. Manual Sync

  • Manually handle Document synchronization
  • Do not connect to a stream to receive Document events
  • Do not add Presence of the Client
await client.attach(doc, { isRealtimeSync: false });

B. Realtime Sync

  • Automatically handle Document synchronization
    • PushPull Mode: Send local changes to other clients and reflect changes from other clients in the local document
    • PushOnly Mode: Send local changes to other clients but do not receive changes from other clients, preventing undoing due to remote changes in IME mode
  • Connect to a stream to receive Document events
  • Add Client Presence to notify other Clients
await client.attach(doc, {
  initialPresence: { color: 'blue', cursor: { x: 0, y: 0 } },
  isRealtimeSync: true,
});

Refer to

Additionally, there is a need for a mode where the user can maintain Realtime Sync(register Presence) but neither send nor receive local changes from other clients.