From 39b178cdebe275cbc8ce19cf269bea7cd15ff4ca Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 4 Jul 2010 22:16:52 +0000 Subject: refactor response body handling for sendfile(2) This hopefully allows the "sendfile" gem to be required anywhere in the Rainbows!/Unicorn config file, and not have to be required via RUBYOPT or the '-r' command-line switch. We also modularize HttpResponse and avoids singleton methods in the response path. This (hopefully) makes it easier for individual concurrency models to share code and override individual methods. --- lib/rainbows/rev_fiber_spawn.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/rainbows/rev_fiber_spawn.rb') diff --git a/lib/rainbows/rev_fiber_spawn.rb b/lib/rainbows/rev_fiber_spawn.rb index afaf82a..4d64e39 100644 --- a/lib/rainbows/rev_fiber_spawn.rb +++ b/lib/rainbows/rev_fiber_spawn.rb @@ -16,8 +16,10 @@ module Rainbows include Fiber::Rev def worker_loop(worker) + Rainbows::HttpResponse.setup(Rainbows::Fiber::Rev::Server) init_worker_process(worker) Server.const_set(:MAX, @worker_connections) + Rainbows::Fiber::Base.setup(Rainbows::Fiber::Rev::Server, nil) Server.const_set(:APP, G.server.app) Heartbeat.new(1, true).attach(::Rev::Loop.default) kato = Kato.new.attach(::Rev::Loop.default) -- cgit v1.2.3-24-ge0c7