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 01:44:34 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-25 03:13:12 -0800
commit4d8304bf0aa5665e8f8474dfb96019297fa0c2b9 (patch)
tree676418a49b5575209c00fb3bcb83db10df8834bc /lib/rainbows/dev_fd_response.rb
parent2bc6e7a3c4e972ee3227d931e79bc4057ba278ca (diff)
This one seems a easy to get working and supports everything we
need to support from the server perspective.  Apps will need
modified drivers, but it doesn't seem too hard to add
more/better support for wrapping IO objects with Fiber::IO.
Diffstat (limited to 'lib/rainbows/dev_fd_response.rb')
-rw-r--r--lib/rainbows/dev_fd_response.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rainbows/dev_fd_response.rb b/lib/rainbows/dev_fd_response.rb
index e4e5f0c..5b90d24 100644
--- a/lib/rainbows/dev_fd_response.rb
+++ b/lib/rainbows/dev_fd_response.rb
@@ -36,6 +36,10 @@ module Rainbows
         else
           headers['X-Rainbows-Autochunk'] = 'no'
         end
+
+        # we need to make sure our pipe output is Fiber-compatible
+        env["rainbows.model"] == :FiberSpawn and
+          return [ status, headers.to_hash, Fiber::IO.new(io,::Fiber.current) ]
       else # unlikely, char/block device file, directory, ...
         return response
       end