Emits a signal through the dispatcher.
        
        :param      signal | <str>
                    *args  | additional arguments
171604
def emit(self, signal, *args):
        
        if not (self.signalsBlocked() or self.signalBlocked(signal)):
            super(XViewDispatch, self).emit(SIGNAL(signal), *args)
1247367
def session_callback(self, signal):
        
        if signal == SIGNAL_DATA:
            self.event.new_event(self.data)

        elif signal == SIGNAL_FAILED:
            self.retry()

        if signal in [SIGNAL_PLAYING, SIGNAL_FAILED] and \
                self.connection_status_callback:
            self.connection_status_callback(signal)
567759
def listens_to(name, sender=None, weak=True):
    
    def decorator(f):
        if sender:
            return signal(name).connect(f, sender=sender, weak=weak)
        return signal(name).connect(f, weak=weak)
    return decorator
131743
def fire(obj, name, *args, **kwargs):
    
    signals = vars(obj).get('_signals', {})
    for func in signals.get(name, ()):
        func(*args, **kwargs)
373049
public function emit($signal, $args = null)
    {
        if ($this->signalsBlocked) {
            return;
        }

        if (isset($this->signals[$signal]) === false) {
            return;
        }

        /* @var $slots MSlot[] */
        $slots = $this->signals[$signal];

        foreach ($slots as /* @var $slot MSlot */
                 $slot) {
            $method = $slot->getMethod();
            $object = $slot->getReceiver();

            if ($args == null) {
                if ($object == null) {
                    $method();
                } else {
                    $object->$method();
                }
            } else {
                if ($object == null) {
                    $method($args);
                } else {
                    $object->$method($args);
                }
            }
        }
    }
826906
def send(self, signal, plugin, **kwargs):
        
        if signal not in self.signals.keys():
            raise UnknownSignal("Unknown signal %s" % signal)
        self.__log.debug("Sending signal %s for %s" % (signal, plugin.name))
        rv = self.signals[signal].send(plugin, **kwargs)
        return rv
811324
def send(self, *sender, **kwargs):
        
        if len(sender) == 0:
            sender = None
        elif len(sender) > 1:
            raise TypeError('send() accepts only one positional argument, '
                            '%s given' % len(sender))
        else:
            sender = sender[0]

        if not self.receivers:
            return []

        rv = list()
        for receiver in self.receivers_for(sender):
            try:
                rv.append((receiver, receiver(sender, **kwargs)))
            except Exception:
                logger.exception('Error while dispatching signal "{}" '
                                 'to receiver'.format(self.name))
        return rv
1121601
def emit(self, signal, message='__nomessagetoken__'):
        
        # call pre-emit hooks
        if signal == 'log':
            self.log_backend.info(message)
        elif signal == 'warn':
            self.log_backend.warn(message)
        elif signal == 'error':
            self.log_backend.error(message)

        return self.emit_to_frontend(signal, message)
1319783
def emit(self, record):
        
        try:
            syslog_msg = self.build_msg(record)
            self.transport.transmit(syslog_msg)
        except Exception:
            self.handleError(record)
685523
def emitRemoved( self ):
        
        # check the signals blocked
        if ( self.signalsBlocked() ):
            return False
        
        # emit the signal
        self.dispatch.removed.emit()
        return True
149403
def get(self, signal=None):
        
        return self.__app.signals.get(signal, self._plugin)
282783
def _signal_handler(self, signal_interupt, frame):  # pylint: disable=W0613
        
        if self.container is not None:
            print('{}{}Stopping docker container.'.format(c.Style.BRIGHT, c.Fore.YELLOW))
            self.container.stop()
        print('{}{}Interrupt signal received.'.format(c.Style.BRIGHT, c.Fore.RED))
        self.log.error('tcrun received an interrupt signal and will now exit.')
        sys.exit(1)
1089462
def emit(self, *args, **kwargs):
        '''
        
        '''
        self._messanger.send(self, *args, **kwargs)
810954
def _generic_signal_handler(self, signal_type):
        
        print("</pre>")
        message = "Got " + signal_type + ". Failing gracefully..."
        self.timestamp(message)
        self.fail_pipeline(KeyboardInterrupt(signal_type), dynamic_recover=True)
        sys.exit(1)
921017
async def send(self, *args, **kwargs):
        
        if not self.frozen:
            raise RuntimeError("Cannot send non-frozen signal.")

        for receiver in self:
            await receiver(*args, **kwargs)
38438
def register_handler(alias: str, handler: callable):
        
        if SignalDispatcher.handlers.get(alias) is None:
            SignalDispatcher.handlers[alias] = [handler]
        else:
            SignalDispatcher.handlers.get(alias).append(handler)
649774
def _signal_handler(self, *_) -> None:
        
        if self._num_signals == 0:
            logging.warning('Interrupt signal caught - training will be terminated')
            logging.warning('Another interrupt signal will terminate the program immediately')
            self._num_signals += 1
        else:
            logging.error('Another interrupt signal caught - terminating program immediately')
            sys.exit(2)