What is the best way to push data from a server written in Sinatra to a client? Think similarly to a chat room, but without Ajax polling every 2500ms.
I know of Juggernaut in Rails, but was curious about Sinatra.
What is the best way to push data from a server written in Sinatra to a client? Think similarly to a chat room, but without Ajax polling every 2500ms.
I know of Juggernaut in Rails, but was curious about Sinatra.
A little googling turned up this blog post by Marc-André Cournoyer, which discusses the asynchronous response feature of the Thin web server and includes a link to an async-sinatra library to do just this. You could also take a look at orbited-ruby, a Ruby implementation of the Orbited Comet server. Both of these appear to be pretty new and untested, so you might have to do a little hacking yourselves to get things working correctly for your application.