如何进行实时并发编辑?
我正在尝试构建一个基本上只是一个文本编辑器的 Rails 应用程序(具有一些我在其他地方找不到的附加功能 - 这就是我构建它的原因)
核心功能之一是实时并发编辑,或实时-时间协作编辑(无论你想怎么称呼它)。
到目前为止,我已经使用名为 Juggernaut 的插件设置了该网站。这使我能够从客户端或服务器发送我想要的任何 Javascript 到每个其他客户端。因此,当有人输入内容时,我可以将该人输入的内容发送给每个其他客户端,而其他客户端无需轮询服务器。
我遇到的问题归结为我不知道使用什么算法来解决冲突并以尽可能最好的方式做到这一点。我已经阅读了一些关于运营转型的内容,但只是简单不知道如何明智地实施它与我现在拥有的 Javascript/Rails 解决方案一起使用。
我想要 OT 之类的东西,但不知道如何实现,也不知道从哪里开始。 任何有关如何实现这一点的帮助我都会非常高兴!
I am trying to build a rails app that's basically just a text-editor (with some additional features I can't find anywhere else - which is why I'm building it)
One of the core features is live concurrent editing, or real-time collaborative editing (whatever you want to call it).
So far I have set up the site with a plugin called Juggernaut. This gives me the ability to send, either from a client or the server, any Javascript I want to every other client. So when someone types something I can send what that person has typed to every other client, without the other clients having to poll the server.
The problem I have boils down to me not knowing what algorithm to use for solving conflicts and doing this the best way possible. I have read up a bit on Operational Transformation, but just simple don't know how to sensibly implement it with the Javascript/Rails-solution I have now.
I want something like OT, but don't know how to implement it and don't know where to start.
Any help on how to implement this would me very happy!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
查看 MobWrite
Take a look at MobWrite
我认为 Google 已经(或即将发布)Wave 的 OT 逻辑是开源的。
也许可以查看 Wave Protocol 开源项目。
I think that Google has (or will soon release), the OT logic of Wave as open source.
Maybe check the Wave Protocol Open Source project.
您看过 Mozilla 的 Bespin 吗?我的意思是为了获得灵感——我知道您正在使用 Rails。
Have you seen Bespin by Mozilla? For inspiration I mean -- I understand that you're using Rails.
虽然这不是完整的答案,但您可以在这里对 Google Wave 的实现方式有一个非常有趣的见解:
http://www.youtube.com/watch?v=3ykZYKCK7AM
While this is not a complete answer you could have a very interesting insight on how Google Wave does it here:
http://www.youtube.com/watch?v=3ykZYKCK7AM
我一直在寻找类似的东西,并且偶然发现了 sharejs。希望这有帮助。
I was looking for something like this and I stumbled upon sharejs. Hope this helps.