about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-07 18:16:27 -0800
committerEric Wong <normalperson@yhbt.net>2011-01-07 18:16:27 -0800
commitbf6eb8f1f79ed57ee317b2e6f73c70a59708739f (patch)
treee5e846bc4d34896c8ca9159ac17eb0bcf22204cc
parent4747aa0d07950b9abbb036bc02491c4639dc9f80 (diff)
It's more natural and easier to maintain this way
since Coolio::Client is always lazy loaded.
-rw-r--r--lib/rainbows/coolio/client.rb3
-rw-r--r--lib/rainbows/coolio/core.rb1
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb
index b4c7b5a..d3d696d 100644
--- a/lib/rainbows/coolio/client.rb
+++ b/lib/rainbows/coolio/client.rb
@@ -4,6 +4,7 @@ class Rainbows::Coolio::Client < Coolio::IO
   include Rainbows::EvCore
   CONN = Rainbows::Coolio::CONN
   KATO = Rainbows::Coolio::KATO
+  LOOP = Coolio::Loop.default
 
   def initialize(io)
     CONN[self] = false
@@ -57,7 +58,7 @@ class Rainbows::Coolio::Client < Coolio::IO
 
   # allows enabling of write watcher even when read watcher is disabled
   def evloop
-    LOOP # this constant is set in when a worker starts
+    LOOP
   end
 
   def next!
diff --git a/lib/rainbows/coolio/core.rb b/lib/rainbows/coolio/core.rb
index 04c5baa..8ee0491 100644
--- a/lib/rainbows/coolio/core.rb
+++ b/lib/rainbows/coolio/core.rb
@@ -11,7 +11,6 @@ module Rainbows::Coolio::Core
     init_worker_process(worker)
     mod = Rainbows.const_get(@use)
     rloop = Rainbows::Coolio::Server.const_set(:LOOP, Coolio::Loop.default)
-    Rainbows::Coolio::Client.const_set(:LOOP, rloop)
     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)