about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-12-16 00:50:23 -0800
committerEric Wong <normalperson@yhbt.net>2009-12-16 00:50:23 -0800
commit2ccce76d94046d017a9b02a0b033e3fff9483e98 (patch)
tree6511477823728371bc4e378b760a16b45da5908a
parent51e656e3db593c662e7abdf969dd79570525aac9 (diff)
downloadrainbows-2ccce76d94046d017a9b02a0b033e3fff9483e98.tar.gz
It gets in the way of Rev/EM-based models that won't use EvCore.
It doesn't actually do anything useful except making an extra
layer of indirection to follow.
-rw-r--r--lib/rainbows/ev_core.rb4
-rw-r--r--lib/rainbows/event_machine.rb2
-rw-r--r--lib/rainbows/rev/core.rb2
3 files changed, 2 insertions, 6 deletions
diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb
index 10d9557..0d3c079 100644
--- a/lib/rainbows/ev_core.rb
+++ b/lib/rainbows/ev_core.rb
@@ -11,10 +11,6 @@ module Rainbows
     # Apps may return this Rack response: AsyncResponse = [ -1, {}, [] ]
     ASYNC_CALLBACK = "async.callback".freeze
 
-    def self.setup(klass)
-      klass.const_set(:APP, G.server.app)
-    end
-
     def post_init
       @remote_addr = ::TCPSocket === @_io ? @_io.peeraddr.last : LOCALHOST
       @env = {}
diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb
index e81914a..bcc0240 100644
--- a/lib/rainbows/event_machine.rb
+++ b/lib/rainbows/event_machine.rb
@@ -190,7 +190,7 @@ module Rainbows
       client_class = Rainbows.const_get(@use).const_get(:Client)
       Server.const_set(:MAX, worker_connections + LISTENERS.size)
       Server.const_set(:CL, client_class)
-      EvCore.setup(client_class)
+      client_class.const_set(:APP, G.server.app)
       EM.run {
         conns = EM.instance_variable_get(:@conns) or
           raise RuntimeError, "EM @conns instance variable not accessible!"
diff --git a/lib/rainbows/rev/core.rb b/lib/rainbows/rev/core.rb
index 90857a2..122d8f4 100644
--- a/lib/rainbows/rev/core.rb
+++ b/lib/rainbows/rev/core.rb
@@ -27,7 +27,7 @@ module Rainbows
         rloop = Server.const_set(:LOOP, ::Rev::Loop.default)
         Server.const_set(:MAX, @worker_connections)
         Server.const_set(:CL, mod.const_get(:Client))
-        EvCore.setup(EvCore)
+        EvCore.const_set(:APP, G.server.app)
         Heartbeat.new(1, true).attach(rloop)
         LISTENERS.map! { |s| Server.new(s).attach(rloop) }
         rloop.run