例如两个user: u1, u2,u1的第一次operation叫u1o1,u2的第一次operation叫u2o1
如果u1,u2 同时做改动 文本的版本 v1
那么queue 里如下
[ u2o1(based v1),u1o1(basedv1) ]
Document server handle u1o1 first, so it can save below info:
- doc_v1 -> start version
- u1o1 -> the changes need to do
- doc_v2 -> version after change
so when the server start to handle u2o1 from the second user, the server would apply the u2o1 to doc_v1, here we got doc_v2*.
So now there are two versions: doc_v2 and doc_v2*.
And document server would somehow ‘merge’ the doc_v2 and doc_v2* to get doc_v3.
doc_v3 would be response to u2.
不同版本是这么merge然后得到新的版本么?还是我想的以上步骤不对。总感觉不太对。
谢谢老师!