diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-01-19 15:06:10 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-19 15:06:27 -0800 |
commit | 9424b13255a238dfa44952ebeb07bea3acee999c (patch) | |
tree | 9a517e9b22a3cc73c9ad16c9288eedf09ac18b8a /t/kgio-pipe-response.ru | |
parent | 7a04133c1ab57923cac8a9de04b00bfe89bcce2d (diff) | |
download | rainbows-9424b13255a238dfa44952ebeb07bea3acee999c.tar.gz |
Coolio and EventMachine only use level-triggered epoll, but being Rainbows!, we live on the EDGE!
Diffstat (limited to 't/kgio-pipe-response.ru')
-rw-r--r-- | t/kgio-pipe-response.ru | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/t/kgio-pipe-response.ru b/t/kgio-pipe-response.ru index edd2aac..9c70d47 100644 --- a/t/kgio-pipe-response.ru +++ b/t/kgio-pipe-response.ru @@ -1,10 +1,18 @@ # must be run without Rack::Lint since that clobbers to_path use Rainbows::DevFdResponse run(lambda { |env| + io = case env["rainbows.model"].to_s + when /Fiber/ + Rainbows::Fiber::IO::Pipe + else + Kgio::Pipe + end.popen('cat random_blob', 'rb') + [ 200, { 'Content-Length' => ::File.stat('random_blob').size.to_s, 'Content-Type' => 'application/octet-stream', }, - Rainbows::Fiber::IO::Pipe.popen('cat random_blob', 'rb') ] + io + ] }) |