I have been using Sinatra for sometime now and I would like to add some realtime features to my web-app by pushing the data via websockets.
I have successfully used the gem 'em-websocket' on its own, but have not been able to write one ruby file that has a sinatra web server AND a web-socket server.
I've tried spinning the run! or start! methods off in separate threads with no success.
Has anyone gotten this to work?
I want to have them in the same file as I can then share variables between the two servers.
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…