Broadcasts an event either to all users or clients, depending on
        event flag
354796
def broadcast(self, event):
        """"""
        try:
            if event.broadcasttype == "users":
                if len(self._users) > 0:
                    self.log("Broadcasting to all users:",
                             event.content, lvl=network)
                    for useruuid in self._users.keys():
                        self.fireEvent(
                            send(useruuid, event.content, sendtype="user"))
                        # else:
                        #    self.log("Not broadcasting, no users connected.",
                        #            lvl=debug)

            elif event.broadcasttype == "clients":
                if len(self._clients) > 0:
                    self.log("Broadcasting to all clients: ",
                             event.content, lvl=network)
                    for client in self._clients.values():
                        self.fireEvent(write(client.sock, event.content),
                                       "wsserver")
                        # else:
                        #    self.log("Not broadcasting, no clients
                        # connected.",
                        #            lvl=debug)
            elif event.broadcasttype == "socks":
                if len(self._sockets) > 0:
                    self.log("Emergency?! Broadcasting to all sockets: ",
                             event.content)
                    for sock in self._sockets:
                        self.fireEvent(write(sock, event.content), "wsserver")
                        # else:
                        #    self.log("Not broadcasting, no sockets
                        # connected.",
                        #            lvl=debug)

        except Exception as e:
            self.log("Error during broadcast: ", e, type(e), lvl=critical)
1308221
def broadcast(self, channel, event, data):
        """"""
        payload = self._server.serialize_event(event, data)
        for socket_id in self.subscriptions.get(channel, ()):
            rv = self._server.sockets.get(socket_id)
            if rv is not None:
                rv.socket.send(payload)
45900
def Publish(self, event_name, msg, delay=0):
    """"""
    events_lib.Events.PublishEvent(event_name, msg, delay=delay)
535081
def emit_event(self, event):
        """"""
        with self._lock:
            listeners = list(self._event_listeners)

        for cb in list(self._event_listeners):
            # noinspection PyBroadException
            try:
                cb(event)
            except:
                # Don't let exceptions from callbacks kill our thread of execution
                logger.exception("Event callback resulted in unhandled exception")
888370
def _make_event(self, value):  # pylint: disable=arguments-differ
        """"""
        super(SystemLED, self)._make_event(
            self._led_type_code,
            self.code,
            value)
1322124
function broadcast(name, data) {
        var prefix = Pilotfish('pluginProperties', 'blower').eventPrefix;
        if (settings.recordEvents) {
            Pilotfish('record', prefix + ':' + name);
        }
        data = data || {};
        data.name = name;
        data.target = Pilotfish('selector', lastClickTarget());
        // TODO: Pass the right data so that this is more useful in the recorder backends
        Pilotfish('trigger', prefix, data);
    }
919947
def announce(self, msg):
        
        self.print_if_verbose("{} -> {}".format(self.network_uid, msg.__class__.__name__))
        self.__trigger_event__(
            event_class=self.MessageAnnounced,
            msg=msg,
        )
1038617
void triggerBasicEvent(Event.EventType type,
                         String message,
                         boolean flushBuffer)
  {
    Event triggeredEvent = new BasicEvent(type, message);

    pushEvent(triggeredEvent, flushBuffer);
  }
470028
def emit(self, event, *args, **kwargs):
        
        self._emit(event, self, *args, **kwargs)
677399
function dispatchEvent (event, data) {
    if (hasDOM()) {
      eventEmitter.dispatchEvent(new CustomEvent(event, data));
    } else if (hasEventEmitter()) {
      eventEmitter.emit(event, data);
    }
  }
9363
def emit(self, event, *args, **kwargs):
        
        for func in self._registered_events[event].values():
            func(*args, **kwargs)
1126309
function(msg, arg) {
			if (gui.Type.isEvent(arg)) {
				arg = new gui.EventSummary(arg);
			}
			gui.Broadcast.dispatchGlobal(msg, arg);
		}
1083384
private void signalDisconnected() {
        if (alternate != null) {
            LOGGER.info("Disconnected from Node {} ({})",
                system(hostname.nameAndAddress()), system(alternate.nameAndAddress()));
        } else {
            LOGGER.info("Disconnected from Node {}", system(hostname.nameAndAddress()));
        }
        if (eventBus != null && eventBus.hasSubscribers()) {
            eventBus.publish(new NodeDisconnectedEvent(hostname));
        }
    }
805769
function emit(eventName, data, parent) {
    if (!this.__listeners || !this.__listeners[eventName]) {
        return;
    }

    let self = this,
        event = new Event(eventName, data, this, parent);

    this
        .getListeners(eventName)
        .forEach((config) => {
            if (config.once === true) {
                self.off(eventName, config.fn, config.context, config.args, config.once);
            }
            execute(event, config);
        });
}
441623
async def send_event(self, client_id, service_name, event_name, event_info, directed_client=None):
        """"""

        if directed_client is not None and directed_client != client_id:
            return

        client_info = self.clients.get(client_id)
        if client_info is None:
            self._logger.warning("Attempted to send event to invalid client id: %s", client_id)
            return

        conn = client_info['connection']

        event = dict(service=service_name)
        if event_info is not None:
            event['payload'] = event_info

        self._logger.debug("Sending event: %s", event)

        await self.server.send_event(conn, event_name, event)
1077401
function broadcastChanges(changes) {
    if (!changes.length) {
      return;
    }
    const intercom = Intercom.getInstance();
    changes.forEach(function (change) {
      intercom.emit(change.event, change.path);
    });
  }
601727
def listen(self):
        
        with Consumer(self.connection, queues=self.queue, on_message=self.on_message,
                      auto_declare=False):
            for _ in eventloop(self.connection, timeout=1, ignore_timeouts=True):
                    pass