Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Example on implementing HTML5 Server Side Event in Rails 3.2

I am trying to introduce HTML5 Server-Side-Event to my Rails 3.2 project. I did some search at Google.com, but most of the examples are using php. There's only one example on Rails that is using Goliath, and I am not using that.

I am using Thin in my development and deploying with passenger. I think it's valid for doing text streaming for SSE. Is there any examples on Rails 3.2 for reference?

like image 732
larryzhao Avatar asked Aug 16 '12 18:08

larryzhao


2 Answers

Rails 4.0 is implementing SSE, upgrading your rails and implementing SSE via rails 4.0 ActiveController::Live is probably the best option.

Otherwise you may be stuck with a less stable/performant/maintained option such as Juggernaut or other frameworks.

Source :
http://ngauthier.com/2013/02/rails-4-sse-notify-listen.html http://edgeguides.rubyonrails.org/4_0_release_notes.html#railties-notable-changes

like image 133
Braden Avatar answered Nov 13 '22 12:11

Braden


You can check out 'Cramp' gem - http://cramp.in/

It's having built in support for HTML5 tehcnologies - WebSockets and SSE

like image 2
kals Avatar answered Nov 13 '22 13:11

kals