https://github.com/phusion/passenger-ruby-server-sent-events-demo
Phusion Passenger: HTML5 Server Side Events demo (Ruby version)
https://github.com/phusion/passenger-ruby-server-sent-events-demo
Last synced: 4 months ago
JSON representation
Phusion Passenger: HTML5 Server Side Events demo (Ruby version)
- Host: GitHub
- URL: https://github.com/phusion/passenger-ruby-server-sent-events-demo
- Owner: phusion
- License: mit
- Created: 2013-08-19T16:12:36.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-09-24T21:01:13.000Z (almost 13 years ago)
- Last Synced: 2023-04-09T13:16:09.291Z (about 3 years ago)
- Language: Ruby
- Size: 103 KB
- Stars: 33
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Phusion Passenger Server Sent Events demo
This app demonstrates [Phusion Passenger's](https://www.phusionpassenger.com/) support for HTML5 Server Sent Events. Every second, the server sends us a random number. The app repeats sends at most 5 numbers per connection, but the browser keeps querying the server so the EventStream is infinite.
## Getting started
bundle install
gem install passenger
passenger start
Then visit http://127.0.0.1:3000/
## Compatibility
* This app uses plain Rack, and thus is framework agnostic.
* Server Sent Events works on Phusion Passenger for Apache, Phusion Passenger for Nginx and Phusion Passenger Standalone.
* At least version 4.0.5 of Phusion Passenger is required.
## Multithreading and performance
Server Sent Events works great on both the open source variant of Phusion Passenger, as well as on [Phusion Passenger Enterprise](https://www.phusionpassenger.com/). For optimal performance, Phusion Passenger Enterprise with multithreading is recommended. You should use the following settings for enabling multithreading. The more concurrent users you have, the higher your thread count should be. As a rule, your thread count should be at least the number of Server Sent Event sessions you have.
Apache:
PassengerConcurrencyModel thread
PassengerThreadCount 64
Nginx:
passenger_concurrency_model thread
passenger_thread_count 64
## Feedback
Please join [the discussion forum](http://groups.google.com/group/phusion-passenger) if you have questions or feedback about this demo.