开发者

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开发者_Go百科? Or is there a better one? Thanks!


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).


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


Well - you could also try Socky: https://github.com/socky/socky-server-ruby

It's ruby-based, and uses WebSocket as base with flash fallback to support most devices. Also it's complete ruby-based so give it a try if you want :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜