def render_chunked(&blk)
      must_support_streaming!
      headers['Transfer-Encoding'] = 'chunked'
      Proc.new { |response|
        @response = response
        response.send_status_no_connection_close('')
        response.send_header
        blk.call
        response.write("0\r\n\r\n")
      }
    end
def render_chunked(&blk)
      must_support_streaming!
      headers['Transfer-Encoding'] = 'chunked'
      Proc.new { |response|
        @response = response
        response.send_status_no_connection_close('')
        response.send_header
        blk.call
        response.write("0\r\n\r\n")
      }
    end
Renders the block given as a parameter using chunked encoding.

 ==== Parameters
 &blk::
   A block that, when called, will use send_chunks to send chunks of data
   down to the server. The chunking will terminate once the block returns.

 ==== Examples
   def stream
     prefix = '<p>'
     suffix = "</p>\r\n"
     render_chunked do
       IO.popen("cat /tmp/test.log") do |io|
         done = false
         until done
           sleep 0.3
           line = io.gets.chomp

           if line == 'EOF'
             done = true
           else
             send_chunk(prefix + line + suffix)
           end
         end
       end
     end
   end

 :api: public