Sinatra streaming with Puma? Sinatra streaming with Puma? ruby ruby

Sinatra streaming with Puma?


I believe the issue revolves around sinatra-sse's explicit use of the EventMachine library, which it does not list as a dependency. It does, however, list Thin in its Gemfile and EventMachine is a core dependency of Thin.

Puma's concurrency model is quite different. In fact, you'll find the following statement right at the top of the project's README:

Puma still improves MRI's throughput by allowing blocking IO to be run concurrently (EventMachine-based servers such as Thin turn off this ability, requiring you to use special libraries).

EDIT

If you're interested in learning more about Rack, Rails, Puma, and SSE, you might enjoy this great blog post by Aaron Patterson, a Ruby/Rails core member and all-around swell guy.