From 7da8f7696fafc22a50dbcded6ca44cad7ae32ab6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 Nov 2009 10:18:02 -0800 Subject: add FiberPool concurrency model 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. --- lib/rainbows/dev_fd_response.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/rainbows/dev_fd_response.rb') 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 -- cgit v1.2.3-24-ge0c7