unicorn_horn 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/unicorn_horn/runner.rb +2 -1
- data/lib/unicorn_horn/worker.rb +2 -1
- data/lib/unicorn_horn.rb +1 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/unicorn_horn/runner.rb
CHANGED
@@ -7,7 +7,7 @@ module UnicornHorn
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def start
|
10
|
-
register :QUIT, :INT, :TERM, :CHLD
|
10
|
+
register :QUIT, :INT, :TERM, :CHLD, :HUP
|
11
11
|
AFTER_FORK << proc{ @workers.clear; forget }
|
12
12
|
@workers.each(&:launch!)
|
13
13
|
|
@@ -19,6 +19,7 @@ module UnicornHorn
|
|
19
19
|
@workers.each{ |w| w.wpid or w.launch! }
|
20
20
|
psleep 1
|
21
21
|
when :CHLD; next
|
22
|
+
when :HUP; raze(:QUIT, 5);
|
22
23
|
when :QUIT; raze(:QUIT, 60); break
|
23
24
|
when :TERM, :INT; raze(:TERM, 5); break
|
24
25
|
end
|
data/lib/unicorn_horn/worker.rb
CHANGED
@@ -9,7 +9,7 @@ module UnicornHorn
|
|
9
9
|
|
10
10
|
def initialize handler
|
11
11
|
@name = handler.respond_to?(:name) ? handler.name : handler.inspect
|
12
|
-
@handler = handler
|
12
|
+
@handler = handler
|
13
13
|
end
|
14
14
|
|
15
15
|
def launch!
|
@@ -23,6 +23,7 @@ module UnicornHorn
|
|
23
23
|
[:TERM, :INT].each { |sig| trap(sig) { exit!(0) } }
|
24
24
|
alive = @tmp
|
25
25
|
m = 0
|
26
|
+
@handler = @handler.new if @handler.respond_to?(:new)
|
26
27
|
logger.info "worker=#{name} ready"
|
27
28
|
|
28
29
|
# the actual loop
|
data/lib/unicorn_horn.rb
CHANGED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Joe Edelman
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-15 00:00:00 -07:00
|
18
18
|
default_executable: hornrunner
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|