This commit is contained in:
John Bintz 2012-09-15 12:29:22 -04:00
commit 4a658a84d8

28
config.ru Normal file
View File

@ -0,0 +1,28 @@
$: << File.expand_path('../lib', __FILE__)
require 'rack-emstream'
class Sender
def initialize
@times = 100
@data = "data"
end
def each
@times.times { |i|
yield @data
}
end
def length
@times * @data.length
end
end
require 'logger'
use Rack::EMStream
run lambda { |env|
sender = Sender.new
[ 200, { 'Content-Length' => sender.length.to_s }, sender ]
}