实时协同编辑 - 它是如何工作的? [英] Real time collaborative editing - how does it work?

查看:104
本文介绍了实时协同编辑 - 它是如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的,我想有接近的文档的实时协同编辑功能(非常类似于谷歌文档样式编辑)的应用程序。

I'm writing an application in which I'd like to have near real time collaborative editing features for documents (Very similar to Google Documents style editing).

我知道如何追踪光标位置,这很简单。只是轮询服务器以往半秒或秒与当前的用户标识,文件名,行号和可以被保存在数据库中的行号,和该轮询请求的返回值的其他用户的光标的位置。

I'm aware of how to keep track of cursor position, that's simple. Just poll the server ever half second or second with the current user id, filename, line number and row number which can be stored in a database, and the return value of this polling request is the position of other user's cursors.

我不知道叫什么怎么做的就是更新以这样一种方式,它不会把你的光标离开并强制完整的重新加载因为这将远远慢,我的目的文档。

What I don't know how to do is update the document in such a way that it won't throw your cursor off and force a full reload as that would be far to slow for my purposes.

这真的只有在谷歌浏览器,preferably火狐以及工作。我并不需要支持任何其他浏览器。

This really only has to work in Google Chrome, preferably Firefox as well. I don't need to support any other browser.

推荐答案

在后台使用了合并来自多个对等协作编辑的算法称为的运营转型。这不是微不足道的实施虽然。

The algorithm used behind the scenes for merging collaborative edits from multiple peers is called operational transformation. It's not trivial to implement though.

另请参阅这个问题获取有用的链接。

See also this question for useful links.

这篇关于实时协同编辑 - 它是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆