Reputation: 1324
I want to have interactions between visitors on my site.
Imagine a chat room.
It basically involves getting the data from everyone and sending it to everyone, this can be done by ajax and what not but I wonder if there is something already there in the wild that would do the heavy lifting for me. I have to say that I got very lost once I start programming Ajax, dont even know how to make tests for it...
I have found the Q42multiplayer library that looks like what I want but they use C# as backend. There is something similar or any other multiplayer thingy I can get some idea or rip some code from (the whole thing will be opensource) for Ruby on Rails?
Upvotes: 3
Views: 289
Reputation: 7715
I've been looking at doing something similar to allow users to tail the log output of long-running processes. I'm looking at doing it via RabbitMQ - the process can publish once and each viewer can subscribe to the queue. Javascript would poll the queue to look for new updates.
Upvotes: 0
Reputation: 83680
Such technology called COMET
http://en.wikipedia.org/wiki/Comet_%28programming%29
In Rails here is one quite good solution that I have used few times: juggernauts http://juggernaut.rubyforge.org/
It is really great simple solution.
Although here is more complex solutions such as nginx_http_push_module http://pushmodule.slact.net/ and others
Upvotes: 2
Reputation: 32627
I wouldn't look at a full ruby/rails solution. That'd make it too heavy and slow.
Take a look at node.js, which allows you to create a javascript server.
And as an example with exactly what you need, you'll find this tutorial.
Upvotes: 1