public async Task UpdateV2(string data) { var update = DecodeString(data); lock (_syncRoot) { _doc.ApplyUpdateV2(update, this); } await Clients.Others.SendAsync("updateV2", data); }
public void B1() { var doc1 = new YDoc(); var doc2 = new YDoc(); doc1.UpdateV2 += (s, e) => { doc2.ApplyUpdateV2(e.data, doc1); }; for (int i = 0; i < N; i++) { doc1.GetText("text").Insert(i, GetRandomChar(_rand).ToString()); } doc1.Destroy(); doc2.Destroy(); }