Open janthurau opened 9 months ago
Consider using the api Y.diffUpdate
, we don't need to load ydoc into memory.
Here is the simulation syncstep1
and syncstep2
code:
if messageYjsSyncStep1
cli_sv = decode(cli_msg)
srv_state = load(name)
diff = Y.diffUpdate(srv_state, cli_sv);
send(writeSyncStep2(diff))
srv_sv = Y.encodeStateVectorFromUpdate(srv_state)
send(writeFirstSyncStep(srv_sv))
else if messageYjsSyncStep2
update = decode(msg)
srv.persist(update)
......
goals: