Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared connections? #6

Open
asabourin opened this issue May 26, 2016 · 1 comment
Open

Shared connections? #6

asabourin opened this issue May 26, 2016 · 1 comment

Comments

@asabourin
Copy link

There's a surprisingly small amount of resources and gems built around Rails' SSE, but this one seems perfect to make it usable at scale while keeping its simplicity, thanks for the great work!

As far as I understand the list of open connections is an instance hash of the singleton Manager class so shared only within the app context but not accessible to a Sidekiq worker or another instance of the app on another server for instance. Do you think there could be an easy to have that connections hash shared across, maybe through references in Redis?

I'm not super familiar with the Rack hijack thing so I'm not sure if that makes it difficult to achieve.
Happy to give it a shot and submit a PR if you can provide some guidance to get started.

Thanks!

@henders
Copy link
Owner

henders commented Jun 27, 2016

Hey @asabourin , sorry for delay in response. My notification settings must be incorrect. Anyway, I purposefully avoided the use of Redis so that deployers of rails apps wouldn't have to set that up. But it could easily be an optional piece of functionality. So definitely feel free to submit a PR.

The lack of Redis has also meant that this SSE engine only works in web servers like Puma and not Unicorn/Passenger where there are process pools. So Redis would allow this gem to work with those as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants