Method called when handling signals
334700
def _signal_handler(self, signum, frame):
        
        if self._options.config:
            with open(self._options.config, "w") as cfg:
                yaml.dump(self._home_assistant_config(), cfg)
                print(
                    "Dumped home assistant configuration at",
                    self._options.config)
        self._connection.close()
        sys.exit(0)
141373
def stop_handling_end_signal(self):
        
        try:
            signal.signal(signal.SIGTERM, signal.SIG_DFL)
            signal.signal(signal.SIGINT, signal.SIG_DFL)
        except ValueError:
            self.log('Signals cannot be caught in a Thread', level='warning')
904456
def signal(sig)
      sig = sig.to_i if sig.to_i != 0
      applog(self, :info, "#{self.name} sending signal '#{sig}' to pid #{self.pid}")
      ::Process.kill(sig, self.pid) rescue nil
    end
1018178
public void signal(Signal signal, CmsUUID id) {

        getStatus(id).handleSignal(signal);
        runSelectionChangeAction();
    }
803072
def signal(value = nil)
      @mutex.synchronize do
        if waiter = @waiters.shift
          waiter << SignalConditionRequest.new(waiter.task, value)
        else
          Internals::Logger.with_backtrace(caller(3)) do |logger|
            logger.debug("Celluloid::Condition signaled spuriously")
          end
        end
      end
    end
1222531
def signal_handler_mapping(self):
    """"""
    # Could use an enum here, but we never end up doing any matching on the specific signal value,
    # instead just iterating over the registered signals to set handlers, so a dict is probably
    # better.
    return {
      signal.SIGINT: self.handle_sigint,
      signal.SIGQUIT: self.handle_sigquit,
      signal.SIGTERM: self.handle_sigterm,
    }
9198
def signal(e):
    
    callback = find_handler(e)
    if callback is None:
        if _activate_debugger:
            print 'Handler for error {0} not found'.format(type(e))
            traceback.print_stack()
            set_trace()
        raise e
    else:
        return callback(e)
147379
def _is_allowed_signal(self, signal):
        

        if signal not in self._allowed_signals:
            raise Exception("Signal '{0}' is not allowed for '{1}'.".format(
                signal, type(self)))
842255
function signals() {

  /**
   *  Signal handler.
   */
  function interrupt(signal) {
    this.log.notice('received %s, scheduling shutdown', signal);
    this.shutdown(0, process.exit);
  }

  interrupt = interrupt.bind(this);

  function iterate(signal) {

    /* test environment listener leak */
    if(process.listeners(signal).length) return;

    process.once(signal, function() {
      interrupt(signal);
    })
  }

  ['SIGINT', 'SIGTERM'].forEach(iterate.bind(this));
}
654862
private void callHandleMethod(Method method, Object instance, ApiZone apiZone,
            Object userAgent) {
        ReflectMethodUtil.invokeHandleMethod(method, instance, context, apiZone, userAgent);
    }
644305
def _trapped_signals(self, client):
    """"""
    signal_handler = PailgunClientSignalHandler(
      client,
      timeout=self._bootstrap_options.for_global_scope().pantsd_pailgun_quit_timeout)
    with ExceptionSink.trapped_signals(signal_handler):
      yield
1360325
def signal_catcher(callback):
    """"""
    def _catch_exit_signal(sig_num, _frame):
        print('Received signal {:d} invoking callback...'.format(sig_num))
        callback()

    signal.signal(signal.SIGINT, _catch_exit_signal)
    signal.signal(signal.SIGQUIT, _catch_exit_signal)
    signal.signal(signal.SIGTERM, _catch_exit_signal)
    yield
290890
function signal() {
  var handlers = []

  notify.add    = add
  notify.once   = once
  notify.remove = remove

  return notify


  // ### Function Signal
  //
  // Notifies all handlers of a signal.
  //
  // :: A... -> ()
  function notify() {
    var args = arguments
    handlers.forEach(function(f){ f.apply(null, args) }) }

  // ### Function add
  //
  // Adds a new handler.
  //
  // :: (A... -> B) -> Signal
  function add(f)  {
    if (handlers.every(isnt(f)))  handlers.push(f)
    return notify }

  // ### Function once
  //
  // Adds a new handler that'll be executed at most once.
  //
  // :: (A... -> B) -> Signal
  function once(f) {
    add(function() { f.apply(this, arguments)
                     remove(f) })
    return notify }

  // ### Function remove
  //
  // Removes a handler.
  //
  // :: (A... -> B) -> Signal
  function remove(f) {
    handlers = handlers.filter(isnt(f))
    return notify }
}
265037
def dispatch():
        
        aliases = SignalDispatcher.signals.keys()

        for alias in aliases:
            handlers = SignalDispatcher.handlers.get(alias)
            signal = SignalDispatcher.signals.get(alias)

            if signal is None or handlers.__len__() == 0:
                continue

            for handler in handlers:
                signal.connect(handler)
799331
def enable_sig_handler(signal_name, handler):
    '''
    
    '''
    if hasattr(signal, signal_name):
        signal.signal(getattr(signal, signal_name), handler)
32115
function handleExit (canCancel, signal, code) {
	var i = 0,
		sub;

	while ((sub = subs[i++])) {
		if (sub[0].call(sub[1], canCancel, signal, code) === false && canCancel) {
			return;
		}
	}

	if (canCancel) {
		process.exit(code);
	}
}
655337
def handle_end_signal(self):
        
        try:
            signal.signal(signal.SIGTERM, self.catch_end_signal)
            signal.signal(signal.SIGINT, self.catch_end_signal)
        except ValueError:
            self.log('Signals cannot be caught in a Thread', level='warning')