about summary refs log tree commit homepage
path: root/lib/rainbows
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows')
-rw-r--r--lib/rainbows/coolio/client.rb1
-rw-r--r--lib/rainbows/coolio/core.rb3
-rw-r--r--lib/rainbows/epoll.rb1
-rw-r--r--lib/rainbows/ev_core.rb5
-rw-r--r--lib/rainbows/event_machine.rb6
5 files changed, 2 insertions, 14 deletions
diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb
index 2947462..6561207 100644
--- a/lib/rainbows/coolio/client.rb
+++ b/lib/rainbows/coolio/client.rb
@@ -2,6 +2,7 @@
 # :enddoc:
 class Rainbows::Coolio::Client < Coolio::IO
   include Rainbows::EvCore
+  APP = Rainbows.server.app
   CONN = Rainbows::Coolio::CONN
   KATO = Rainbows::Coolio::KATO
   LOOP = Coolio::Loop.default
diff --git a/lib/rainbows/coolio/core.rb b/lib/rainbows/coolio/core.rb
index 8ee0491..cbdadad 100644
--- a/lib/rainbows/coolio/core.rb
+++ b/lib/rainbows/coolio/core.rb
@@ -7,14 +7,11 @@ module Rainbows::Coolio::Core
   # for connections and doesn't die until the parent dies (or is
   # given a INT, QUIT, or TERM signal)
   def worker_loop(worker)
-    Rainbows::Response.setup(Rainbows::Coolio::Client)
     init_worker_process(worker)
     mod = Rainbows.const_get(@use)
     rloop = Rainbows::Coolio::Server.const_set(:LOOP, Coolio::Loop.default)
     Rainbows::Coolio::Server.const_set(:MAX, @worker_connections)
     Rainbows::Coolio::Server.const_set(:CL, mod.const_get(:Client))
-    Rainbows::EvCore.const_set(:APP, Rainbows.server.app)
-    Rainbows::EvCore.setup
     Rainbows::Coolio::Heartbeat.new(1, true).attach(rloop)
     LISTENERS.map! { |s| Rainbows::Coolio::Server.new(s).attach(rloop) }
     rloop.run
diff --git a/lib/rainbows/epoll.rb b/lib/rainbows/epoll.rb
index 8698f78..52216b3 100644
--- a/lib/rainbows/epoll.rb
+++ b/lib/rainbows/epoll.rb
@@ -15,7 +15,6 @@ module Rainbows::Epoll
 
   def worker_loop(worker) # :nodoc:
     init_worker_process(worker)
-    Rainbows::EvCore.setup
     Rainbows::Client.__send__ :include, Client
     Server.run
   end
diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb
index d218553..8d3511a 100644
--- a/lib/rainbows/ev_core.rb
+++ b/lib/rainbows/ev_core.rb
@@ -125,6 +125,7 @@ module Rainbows::EvCore
   end
 
   TmpIO = Unicorn::TmpIO
+  CBB = Unicorn::TeeInput.client_body_buffer_size
 
   def io_for(bytes)
     bytes <= CBB ? StringIO.new("") : TmpIO.new
@@ -142,8 +143,4 @@ module Rainbows::EvCore
       max ? CapInput.new(io_for(max), self, max) : TmpIO.new
     end
   end
-
-  def self.setup
-    const_set :CBB, Unicorn::TeeInput.client_body_buffer_size
-  end
 end
diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb
index 990a186..c78a406 100644
--- a/lib/rainbows/event_machine.rb
+++ b/lib/rainbows/event_machine.rb
@@ -48,11 +48,6 @@ module Rainbows::EventMachine
 
   include Rainbows::Base
 
-  def init_worker_process(worker) # :nodoc:
-    Rainbows::Response.setup(Rainbows::EventMachine::Client)
-    super
-  end
-
   # runs inside each forked worker, this sits around and waits
   # for connections and doesn't die until the parent dies (or is
   # given a INT, QUIT, or TERM signal)
@@ -71,7 +66,6 @@ module Rainbows::EventMachine
     Rainbows::EventMachine::Server.const_set(:MAX, max)
     Rainbows::EventMachine::Server.const_set(:CL, client_class)
     client_class.const_set(:APP, Rainbows.server.app)
-    Rainbows::EvCore.setup
     EM.run {
       conns = EM.instance_variable_get(:@conns) or
         raise RuntimeError, "EM @conns instance variable not accessible!"