lib/resque/worker.rb
# Registers the various signal handlers a worker responds to.
#
# TERM: Shutdown immediately, stop processing jobs (unless
#       `self.graceful_term` is true, in which case only shutdown after the
#       current job has finished processing).
#  INT: Shutdown immediately, stop processing jobs.
# QUIT: Shutdown after the current job has finished processing.
# USR1: Kill the forked child immediately, continue processing jobs.
# USR2: Don't process any new jobs
# CONT: Start processing jobs again after a USR2
Registers the various signal handlers a worker responds to.
TERM: Shutdown immediately, stop processing jobs (unless
`self.graceful_term` is true, in which case only shutdown after the
current job has finished processing).
INT: Shutdown immediately, stop processing jobs.
QUIT: Shutdown after the current job has finished processing.
USR1: Kill the forked child immediately, continue processing jobs.
USR2: Don't process any new jobs
CONT: Start processing jobs again after a USR2
Registers the various signal handlers a worker responds to . TERM : Shutdown immediately stop processing jobs ( unless ` self . graceful_term ` is true in which case only shutdown after the current job has finished processing ) . INT : Shutdown immediately stop processing jobs . QUIT : Shutdown after the current job has finished processing . USR1 : Kill the forked child immediately continue processing jobs . USR2 : Don ' t process any new jobs CONT : Start processing jobs again after a USR2
def register_signal_handlers
      trap('TERM') { graceful_term ? shutdown : shutdown! }
      trap('INT')  { shutdown!  }
      begin
        trap('QUIT') { shutdown   }
        trap('USR1') { kill_child }
        trap('USR2') { pause_processing }
        trap('CONT') { unpause_processing }
      rescue ArgumentError
        warn "Signals QUIT, USR1, USR2, and/or CONT not supported."
      end
      log! "Registered signals"
    end
def register_signal_handlers trap ( 'TERM' ) { graceful_term ? shutdown : shutdown! } trap ( 'INT' ) { shutdown! } begin trap ( 'QUIT' ) { shutdown } trap ( 'USR1' ) { kill_child } trap ( 'USR2' ) { pause_processing } trap ( 'CONT' ) { unpause_processing } rescue ArgumentError warn "Signals QUIT, USR1, USR2, and/or CONT not supported." end log! "Registered signals" end
Registers the various signal handlers a worker responds to.
Registers the various signal handlers a worker responds to .