about summary refs log tree commit homepage
path: root/lib/rainbows/dev_fd_response.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-25 10:18:02 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-25 11:58:46 -0800
commit7da8f7696fafc22a50dbcded6ca44cad7ae32ab6 (patch)
tree981fe68952ed4d96196d5057abf8402b562690d4 /lib/rainbows/dev_fd_response.rb
parent69b3f0f1627744926f53d13714ba62f0e83333c8 (diff)
downloadrainbows-7da8f7696fafc22a50dbcded6ca44cad7ae32ab6.tar.gz
This is another Fiber-based concurrency model that can exploit
a streaming "rack.input" for clients.  Spawning Fibers seems
pretty fast, but maybe there are apps that will benefit from
this.
Diffstat (limited to 'lib/rainbows/dev_fd_response.rb')
-rw-r--r--lib/rainbows/dev_fd_response.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rainbows/dev_fd_response.rb b/lib/rainbows/dev_fd_response.rb
index 5b90d24..9ad326c 100644
--- a/lib/rainbows/dev_fd_response.rb
+++ b/lib/rainbows/dev_fd_response.rb
@@ -38,8 +38,10 @@ module Rainbows
         end
 
         # we need to make sure our pipe output is Fiber-compatible
-        env["rainbows.model"] == :FiberSpawn and
+        case env["rainbows.model"]
+        when :FiberSpawn, :FiberPool
           return [ status, headers.to_hash, Fiber::IO.new(io,::Fiber.current) ]
+        end
       else # unlikely, char/block device file, directory, ...
         return response
       end