Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created March 3, 2013 02:07
Show Gist options
  • Save josevalim/5074150 to your computer and use it in GitHub Desktop.
Save josevalim/5074150 to your computer and use it in GitHub Desktop.
# 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]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment