Skip to content

Instantly share code, notes, and snippets.

@lmarlow
Forked from thinkerbot/config.ru
Last active December 26, 2015 18:59
Show Gist options
  • Save lmarlow/7198435 to your computer and use it in GitHub Desktop.
Save lmarlow/7198435 to your computer and use it in GitHub Desktop.
# [config.ru]
#
# puma
# curl http://localhost:9292/
#
# Note chrome buffers like 1024 or so... meaning the first lots will look missing.
use Rack::Chunked
run lambda { |env|
def each
10.times do |i|
n = 2
str = "#{i}: #{('a'..'z').sort_by { rand }.take(rand(26)).join}\n"
yield str
sleep 1
end
end
[200, {}, self]
}
@lmarlow
Copy link
Author

lmarlow commented Oct 28, 2013

Added some random data and curl --raw to show the chunking protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment