def register_signal_handlers
      trap('TERM') { shutdown! }
      trap('INT')  { shutdown! }

      begin
        trap('QUIT') { shutdown }
      rescue ArgumentError
        warn "Signals TERM and/or QUIT not supported."
      end

      log! "Registered signals"
    end
def register_signal_handlers
      trap('TERM') { shutdown! }
      trap('INT')  { shutdown! }

      begin
        trap('QUIT') { shutdown }
      rescue ArgumentError
        warn "Signals TERM and/or QUIT not supported."
      end

      log! "Registered signals"
    end
Registers the various signal handlers a worker responds to.

 TERM: Shutdown immediately, stop processing jobs.
  INT: Shutdown immediately, stop processing jobs.
 QUIT: Shutdown after the current job has finished processing.