tags:

views:

1765

answers:

1

What is the best way to push data from a server written in Sinatra (ruby) to a client? Think similar to a chat room, but without ajax polling every 2500ms. I know of Juggernaut in rails, but was curious about Sinatra.

Thanks,

-Tom

+3  A: 

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.

Greg Campbell