diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..80008b7 --- /dev/null +++ b/config.ru @@ -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 ] +}