# File lib/god/watch.rb, line 110 def action(a, c = nil) if !self.driver.in_driver_context? # called from outside Driver # send an async message to Driver self.driver.message(:action, [a, c]) else # called from within Driver case a when :start call_action(c, :start) sleep(self.start_grace + self.grace) when :restart if self.restart call_action(c, :restart) else action(:stop, c) action(:start, c) end sleep(self.restart_grace + self.grace) when :stop call_action(c, :stop) sleep(self.stop_grace + self.grace) end end self end