Revisions
-
andriytyurnikov revised this gist
Mar 3, 2013 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,16 @@ # rackup -s puma require 'puma' # thin does some weird caching run proc { |env| body = Enumerator.new do |socket| socket << " "*1024 # Browsers wait for time or big data chunk 5.times do socket << "Hello" puts "Hello" sleep 1 end end # if Content-Type is text/html, html parser may delay rendering of text [200, { "Content-Encoding" => "chunked" }, body] } -
josevalim created this gist
Mar 3, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # rackup -s thin require 'thin' run proc { |env| body = Enumerator.new do |socket| 5.times do socket << "Hello" puts "Hello" sleep 1 end end [200, { 'Content-Type' => 'text/html', "Content-Encoding" => "chunked" }, body] }