lib/navy/captain.rb in navy-1.0.6 vs lib/navy/captain.rb in navy-1.0.7
- old
+ new
@@ -118,16 +118,18 @@
logger.info "captain[#{label}] complete"
end
# Terminates all captains, but does not exit admiral process
def stop(graceful = true)
+ before_stop.call(self, graceful) if before_stop
limit = Time.now + timeout
until OFFICERS.empty? || Time.now > limit
kill_each_officer(graceful ? :QUIT : :TERM)
sleep(0.1)
reap_all_officers
end
kill_each_officer(:KILL)
+ after_stop.call(self, graceful) if after_stop
end
private
# wait for a signal hander to wake us up and then consume the pipe
\ No newline at end of file