lib/pitchfork/children.rb in pitchfork-0.9.0 vs lib/pitchfork/children.rb in pitchfork-0.10.0

- old
+ new

@@ -105,9 +105,36 @@ def each_worker(&block) @workers.each_value(&block) end + def soft_kill_all(sig) + each do |child| + child.soft_kill(sig) + end + end + + def hard_kill(sig, child) + child.hard_kill(sig) + rescue Errno::ESRCH + reap(child.pid) + child.close + end + + def hard_kill_all(sig) + each do |child| + hard_kill(sig, child) + end + end + + def hard_timeout(child) + child.hard_timeout! + rescue Errno::ESRCH + reap(child.pid) + child.close + true + end + def workers @workers.values end def fresh_workers