Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to build a chat room using Rails, should I use juggernaut 2 or cramp?

Originally I planned to use Juggernaut, however, it is not compatible with Rails 3. And new Juggernaut 2 seems to be completely independent from Rails, which is not what I want. Then I found cramp, it looks quite neat, but is still under development. So I am just wondering which framework should I use? Or is there a better one? Thanks!

like image 748
JayX Avatar asked Jan 29 '11 23:01

JayX


2 Answers

You're right that the new Juggernaut is de-coupled from Rails, but that doesn't mean you can't use the two together. Juggernaut comes with a Ruby library. Using Juggernaut solves the long-lived connection problem that Toby was talking about.

Any questions about Juggernaut, ping me a line (I'm the creator).

like image 77
Alex MacCaw Avatar answered Sep 28 '22 03:09

Alex MacCaw


I have looked at the options for this stuff quite extensively and real-time chat is a bit against the grain of Rails. If you really want to stay inside Rails, then Cramp is probably the best option. I recommend you have a look at this article on Websockets and Rails as well: http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/

Using EventMachine to handle the communication means you are that even though you will still be outside Rails, you are at least in Ruby and can share models and libraries.

I have a Async Rails build on GitHub: https://github.com/tobyhede/AsyncRails

Which is largely based on: https://github.com/igrigorik/async-rails

like image 33
Toby Hede Avatar answered Sep 28 '22 04:09

Toby Hede