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 CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.8.1 / 2009-11-12
2
+
3
+ * 3 Bug Fixes
4
+ * Attempting to wakeup a dead thread in Prefork
5
+ * Shutdown error between the Prefork parent/child
6
+ * Restart was not working properly
7
+
1
8
  == 0.8.0 / 2009-11-12
2
9
 
3
10
  * 2 Major Enhancements
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 5
21
+ sleep 2
21
22
  end
22
23
  end
23
24
 
24
- p = Servolux::Prefork.new :module => DoThis, :timeout => 0.5
25
+ p = Servolux::Prefork.new :module => DoThis
25
26
  p.start 6
26
- sleep 10
27
+ gets
27
28
  p.stop
28
29
 
29
- p.errors { |e|
30
- puts e.inspect
30
+ p.errors { |w|
31
+ puts w.error.inspect
31
32
  }
33
+
34
+ Process.waitall
@@ -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
@@ -2,7 +2,7 @@
2
2
  module Servolux
3
3
 
4
4
  # :stopdoc:
5
- VERSION = '0.8.0'
5
+ VERSION = '0.8.1'
6
6
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
7
7
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
8
8
  # :startdoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servolux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease