servolux 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/a.rb +8 -5
- data/lib/servolux/prefork.rb +5 -5
- data/lib/servolux.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/a.rb
CHANGED
@@ -12,20 +12,23 @@ module DoThis
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def after_executing
|
15
|
+
STDOUT.puts "Closing #$$.txt"
|
15
16
|
@fd.close
|
16
17
|
end
|
17
18
|
|
18
19
|
def execute
|
19
20
|
@fd.puts "Process #$$ @ #{Time.now}"
|
20
|
-
sleep
|
21
|
+
sleep 2
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
|
-
p = Servolux::Prefork.new :module => DoThis
|
25
|
+
p = Servolux::Prefork.new :module => DoThis
|
25
26
|
p.start 6
|
26
|
-
|
27
|
+
gets
|
27
28
|
p.stop
|
28
29
|
|
29
|
-
p.errors { |
|
30
|
-
puts
|
30
|
+
p.errors { |w|
|
31
|
+
puts w.error.inspect
|
31
32
|
}
|
33
|
+
|
34
|
+
Process.waitall
|
data/lib/servolux/prefork.rb
CHANGED
@@ -227,7 +227,7 @@ class Servolux::Prefork
|
|
227
227
|
return if @thread.nil? or @piper.nil? or @piper.child?
|
228
228
|
|
229
229
|
@thread[:stop] = true
|
230
|
-
@thread.wakeup
|
230
|
+
@thread.wakeup if @thread.status
|
231
231
|
Thread.pass until !@thread.status
|
232
232
|
kill 'HUP'
|
233
233
|
@thread = nil
|
@@ -285,7 +285,7 @@ class Servolux::Prefork
|
|
285
285
|
when START; break
|
286
286
|
when ERROR
|
287
287
|
raise Timeout,
|
288
|
-
"Child did not respond in a timely fashion. Timeout is set to #{@prefork.timeout} seconds."
|
288
|
+
"Child did not respond in a timely fashion. Timeout is set to #{@prefork.timeout.inspect} seconds."
|
289
289
|
when Exception
|
290
290
|
raise response
|
291
291
|
else
|
@@ -296,10 +296,10 @@ class Servolux::Prefork
|
|
296
296
|
rescue Exception => err
|
297
297
|
@error = err
|
298
298
|
ensure
|
299
|
-
@piper.timeout = 0
|
299
|
+
@piper.timeout = 0.1
|
300
300
|
@piper.puts HALT rescue nil
|
301
301
|
@piper.close
|
302
|
-
self.start if START == response
|
302
|
+
self.start if START == response and !Thread.current[:stop]
|
303
303
|
end
|
304
304
|
}
|
305
305
|
Thread.pass until @thread[:stop] == false
|
@@ -332,7 +332,7 @@ class Servolux::Prefork
|
|
332
332
|
break
|
333
333
|
when ERROR
|
334
334
|
raise Timeout,
|
335
|
-
"Parent did not respond in a timely fashion. Timeout is set to #{@prefork.timeout} seconds."
|
335
|
+
"Parent did not respond in a timely fashion. Timeout is set to #{@prefork.timeout.inspect} seconds."
|
336
336
|
else
|
337
337
|
raise UnknownSignal,
|
338
338
|
"Child received unknown signal: #{signal.inspect}"
|
data/lib/servolux.rb
CHANGED