From a764983fccd6cce64043d76e09a5e1718e7f8fd6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 17 Oct 2009 22:42:56 -0700 Subject: refactor graceful shutdowns again, harder We use the "G" global constant from the Rev model everywhere to simplify things a little. Test cases are more consistent now, too. --- lib/rainbows.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/rainbows.rb') 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' -- cgit v1.2.3-24-ge0c7