Forum: Ruby on Rails Real-time message passing to browser in Rails?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
69f4b9b411dfcaebe01d0fde8c751726?d=identicon&s=25 Nate (Guest)
on 2007-01-24 21:22
(Received via mailing list)
Has anyone had any success getting "realtime" message passed to the
browser in Rails? I'm wondering if there's a helper or Prototype
snippet that can help pass messages to a "status" window.

Basically, I have an app that is doing system tasks, like running
command-line scripts and tailing logfiles. I want to show the output in
near-realtime, similar to what a user would see in a command-line
terminal window. Any ideas?

Thanks,
Nate Wiger
dangerrabbit.com
Efe398b3b5436b0a8d4430090e8f86ea?d=identicon&s=25 seth b. (subimage)
on 2007-01-24 21:27
(Received via mailing list)
Haven't used it personally, but it sounds like you want Comet...

http://ajaxian.com/archives/juggernaut-comet-for-rails

On 1/24/07, Nate <nwiger@gmail.com> wrote:
>
> Thanks,
> Nate Wiger
> dangerrabbit.com
>
>
> >
>


--
--------------------
seth at subimage interactive
-----
http://www.subimage.com
http://sublog.subimage.com
-----
http://www.getcashboard.com
http://dev.subimage.com/projects/substruct
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-01-24 21:27
(Received via mailing list)
Nate wrote:

> Has anyone had any success getting "realtime" message passed to the
> browser in Rails? I'm wondering if there's a helper or Prototype
> snippet that can help pass messages to a "status" window.

Here's my How To Chat post:

http://www.forbiddenweb.org/topic/130997/index.html

GMail reputedly chats by leaving the HTTP socket open. I wouldn't
tweak my server (and the prototype Ajax objects) just for a Status
panel.

Use periodically_call_remote to repeatedly call the status action on
the server. That's slow, and high-bandwidth, but completely stable. My
Chat post tells generally how.

Tip: Have one periodically_call_remote per page, and let it update
anything that needs updating, via render :update.

--
  Phlip
  http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!
69f4b9b411dfcaebe01d0fde8c751726?d=identicon&s=25 Nate (Guest)
on 2007-01-24 22:50
(Received via mailing list)
Awesome, very nice, detailed chat post, thanks!
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 Rick Olson (Guest)
on 2007-01-25 03:00
(Received via mailing list)
On 1/24/07, Nate <nwiger@gmail.com> wrote:
>
> Has anyone had any success getting "realtime" message passed to the
> browser in Rails? I'm wondering if there's a helper or Prototype
> snippet that can help pass messages to a "status" window.
>
> Basically, I have an app that is doing system tasks, like running
> command-line scripts and tailing logfiles. I want to show the output in
> near-realtime, similar to what a user would see in a command-line
> terminal window. Any ideas?

If you happen to be using lighttpd...
http://www.refwell.com/blog/index.php/2007/01/25/f...

--
Rick Olson
http://weblog.techno-weenie.net
http://mephistoblog.com
67f61f0c385168c4b2e5b8fd733c397f?d=identicon&s=25 Christos Zisopoulos (Guest)
on 2007-01-25 19:31
(Received via mailing list)
Just a little thing to keep in mind:

Keeping network sockets open can quickly saturate your server's
network stack and degrade performance to the point where no new
connections are accepted and the server grinds to a halt.

I am not sure what your user base is, but if you are expecting it to
be in the thousands, all connected with open sockets, then you should
really check what the upper socket limits for your server's network
stack are.

At the very least you should kill inactive sockets after a timeout. I
have not used either of the solutions mentioned in the replies but it
is highly likely that the have an idle timeout setting.

-christos
This topic is locked and can not be replied to.