views:

213

answers:

4

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!

+2  A: 

Take a look at MobWrite

Devon_C_Miller
I had not seen this, as I understand it Bespin is using MobWrite, so I'm definitely gonna take a look at this!
ique
+3  A: 

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.

mjv
A: 

Have you seen Bespin by Mozilla? For inspiration I mean -- I understand that you're using Rails.

Ates Goral
A: 

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

OscarRyz