Hacker Newsnew | past | comments | ask | show | jobs | submit | andrewhavens's commentslogin

Sounds more like a problem with your implementation. I'm pretty sure Puma can handle SSE just fine. Your implementation probably depends on EventMachine which is not baked in like it is with Thin.


I'm doing:

content_type "text/event-stream" stream(:keep_open) { |out| settings.connections << out }

From Sinatra, which I assume is then deferring to EventMachine, courtesy of Thin. I'll see if there's a way of forcing EM directly in to the Stream setup...thanks for the pointer.


I'm one of the authors behind Phusion Passenger (https://www.phusionpassenger.com/), a polyglot web server for Ruby, Python and Node.js.

We recently wrote a demo demonstrating SSE on Phusion Passenger (https://github.com/phusion/passenger-ruby-server-side-events...). During writing of this demo, we found out that sinatra-contrib's streaming code relies on EventMachine. That means that sinatra-contrib's streaming only works on EventMachine-based servers, like Thin and on Goliath.

Based on my knowledge about Puma, I'm pretty sure SSE works fine on Puma as well. The Phusion Passenger SSE demo uses the Rack socket hijacking API (which we've blogged about: http://blog.phusion.nl/2013/01/23/the-new-rack-socket-hijack...) to implement SSE. This approach should work on Puma as well because it supports the Rack socket hijacking API too.


I created a sample app using Puma and Celluloid to work through similar troubles I was having with Sinatra's streams and Puma. If it helps, it's here: https://github.com/sdeming/cellfun. This does not use EventMachine, depending instead on Celluloid. I work primarily in JRuby and EventMachine has always tripped me up.


At least use HTTPS so that our passwords aren't passed in plain text across the internet. Or, like you said, implement some sort of OAuth2 login so we can log in with Twitter, Facebook, GitHub, Persona, etc.

(correction) looks like you can use HTTPS, but it is optional. It should be required on login page at least.


Wow, this is pretty awesome. We run into this issue all the time. Mainly using staging for an external demo, but needing to deploy production updates before the branch on staging is ready to go live. Great work LayerVault!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: