I want my server to send a multipart response (multipart/x-mixed-replace). I\'d prefer some kind of solution using the Sinatra framework or a generic Rack app, but any examp
You can probably use the out.flush method for this:
class TestController < ApplicationController
def index
render :text => lambda { |resp, out|
out.puts 'start'
out.flush
10.times do
out.puts '.'
out.flush
sleep 1
end
out.puts 'done'
}
end
end
However, keep in mind that if you're using Mongrel to serve your Ruby code (as many people using RoR do), you won't be able to stream at all.