about summary refs log tree commit homepage
path: root/lib/rainbows.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r--lib/rainbows.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb
index 7978288..096f700 100644
--- a/lib/rainbows.rb
+++ b/lib/rainbows.rb
@@ -3,6 +3,12 @@ require 'unicorn'
 
 module Rainbows
 
+  # global vars because class/instance variables are confusing me :<
+  # this struct is only accessed inside workers and thus private to each
+  G = Struct.new(:cur, :max, :logger, :alive, :app).new
+  # G.cur may not be used the network concurrency model
+  G.alive = true
+
   require 'rainbows/const'
   require 'rainbows/http_server'
   require 'rainbows/http_response'