Skip to content

Commit

Permalink
remove dead worker tracking, this is done in the piper now.
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime committed Feb 7, 2012
1 parent 2175ae8 commit 5d5ae67
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/servolux/prefork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def initialize( opts = {}, &block )
@min_workers = opts.fetch(:min_workers, nil)
@module = Module.new { define_method :execute, &block } if block
@workers = []
@harvest = Queue.new

raise ArgumentError, 'No code was given to execute by the workers.' unless @module
end
Expand Down Expand Up @@ -207,9 +206,8 @@ def stop
# @return [Prefork] self
#
def reap
while !@harvest.empty?
pid = @harvest.pop
Process.wait pid rescue nil
each_worker do |w|
w.alive?
end
self
end
Expand Down Expand Up @@ -341,7 +339,6 @@ class Worker
#
def initialize( prefork )
@timeout = prefork.timeout
@harvest = prefork.harvest
@thread = nil
@piper = nil
@error = nil
Expand Down Expand Up @@ -455,7 +452,6 @@ def parent
rescue StandardError => err
@error = err
ensure
@harvest << @piper.pid
close_parent
start if START == response and !Thread.current[:stop]
end
Expand Down Expand Up @@ -494,7 +490,6 @@ def parent_loop
# signals and communication with the parent.
#
def child
@harvest = nil

# if we get a HUP signal, then tell the parent process to stop this
# child process and start a new one to replace it
Expand Down

0 comments on commit 5d5ae67

Please sign in to comment.