Rails 3: Real-time server push?
Asked Answered
A

5

6

I'm trying to write a Rails 3 application in which a server can push data to multiple clients in real time.

I've heard of Juggernaut, but I've also heard that it does not work with Rails 3. I tried APE (AJAX Push Engine), but I'm not having much luck with it.

I'm very new to Rails. I can't find many guides that involve real-time push, and Rails 3. I was looking for a free, easy (if possible) solution to this. If anyone could point me in the right direction, I'd greatly appreciate it.

Aceves answered 12/9, 2011 at 8:32 Comment(1)
If you'll be using Faye, this railscast might come in handy.Infatuate
P
5

Check out Faye: http://faye.jcoglan.com/ - I hear really good things about it.

if you're looking for a hosted solution, i've used Pusher http://pusher.com/ in the past, and loved it. i converted a site that used ajax polling over to pusher in about 30 minutes.

Preponderant answered 12/9, 2011 at 13:24 Comment(0)
T
1

You can try juggernaut to do what you want.

The github repository : https://github.com/maccman/juggernaut Example of application with juggernaut : https://github.com/maccman/holla

Enjoy :)

Tetratomic answered 12/9, 2011 at 10:43 Comment(3)
@agmcleod i want to use it in my next app :) it's hard to make it work ?Tetratomic
Nah, it's reasonably straight forward. Just need to launch the juggernaut and redis processes. Then make sure your rails app is setup to work with it. The documentation on the github repo worked pretty well for me.Between
@Between thanks for the tips and if i have some problem answer to my question in the future :pTetratomic
G
0

Have you looked into http://socket.io ? It powers the push functions behind Juggernaut, if I recall correctly.

There appears to be a library for Rails here: https://github.com/markjeee/Socket.IO-rack -- it says 2.3+, which I assume means 3 is ok (though I'm not a Ruby guy, so I wouldn't really know).

Gigahertz answered 12/9, 2011 at 13:26 Comment(0)
S
0

In keeping with the Pusher suggestion, there's RMSN - a drop in replacement I've written using NowJS. https://github.com/leppert/RMSN

Sauceda answered 10/11, 2011 at 5:52 Comment(0)
N
0

Starting with Rails 4, you could also use Entangled:

https://github.com/so-entangled/rails

It basically keeps all data between client and server in sync in real time through web sockets. It's easy to set up, so give it a try.

Nosing answered 13/2, 2015 at 8:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.