Open donv opened 9 years ago
It looks like you're using a web server that doesn't support async callbacks:
2015-04-13 13:15:36 - SinatraWebsocket::Error::ConfigurationError - Could not find an async callback in our environment!:
I've been using Thin. I think a few other servers are supported, but it seems that puma is not one of them.
Ah, I see. Thank you. What server is used when I do showoff serve
?
Thanks @simulacre ! Indeed, it uses Thin locally and works well. I still want to explore using puma and see if it can work, before switching to Thin if necessary.
I did find this issue that (if I read it correctly) states that puma 2 supports async callbacks.
https://github.com/puma/puma/issues/3
But sinatra+puma don't work together?
It looks like Puma uses an different internal API for streaming than what the sinatra-websocket code is expecting. It should be possible to make it work, but I haven't looked at the Puma code in detail yet.
@simulacre Please look into it - want to upgrade for better performance and concurrency but can't while I'm using this :|
@kethomassen if you setup your Profile to use Thin it should work on Heroku. I tested the showoff app just now on Heroku and had no problems.
https://github.com/simulacre/sinatra-websocket/pull/19/files#diff-5bd6b85c2d6fc987875f4bf82de2a15aR1
@simulacre I was meaning looking into Puma support, I want to use it over Thin for the improvements it has.
Not relevant for Heroku but similar problem happens when running showoff behind a nginx-based revese proxy. A workaround exists: https://github.com/gruis/sinatra-websocket/issues/23#issuecomment-1594319679
Hi!
I have an app at with source at
https://github.com/donv/ruby_for_java_developers
running at
http://ruby-for-java.herokuapp.com/
When users connect, a websocket should be opened to enable a follow mode if the user presses the
g
key.However, when users now connect, the websocket request fails on the server with error 500. Any idea what could be wrong?