Publish an event back to crossbar
        :param event: Event object
760219
async def emit_event(self, event):
        
        self.log.debug("publishing event on %s", self.publish_topic)
        if self.config.extra['config']['pub_options']['retain']:
            try:
                await persist_event(
                    self.publish_topic,
                    event,
                    self.pool
                )
            except SystemError as error:
                self.log.error(error)
                return

        try:
            await self.publish(
                self.publish_topic,
                event.__dict__,
                options=self.publish_options
            )
        except TransportLost as error:
            for task in asyncio.Task.all_tasks():
                task.cancel()
            asyncio.get_event_loop().stop()
            self.log.error(error)
885260
def showEvent(self, event):
        
        super(CodeEdit, self).showEvent(event)
        self.panels.refresh()
1074994
def focusOutEvent(self, event):
        
        if not self.signalsBlocked():
            self.focusChanged.emit(False)
            self.focusExited.emit()
        
        return super(XTextEdit, self).focusOutEvent(event)
541210
def write_event(self, event):
        

        if not self.header_written:
            self._out.write("<stream>")
            self.header_written = True

        event.write_to(self._out)
1023619
def mouseReleaseEvent( self, event ):
        
        if event.button() == Qt.MidButton:
            self.setViewMode(False)
            event.accept()
            return
        
        super(XNodeScene, self).mouseReleaseEvent(event)
        
        # reset the selection blocked signals
        self.blockSelectionSignals(False)
        
        # finish the connection
        if ( self.isConnecting() ):
            self.finishConnection()
        
        # emit a menu request signal if necessary
        elif ( not event.isAccepted() and event.button() == Qt.RightButton ):
            item = self.itemAt(event.scenePos())
            if isinstance(item, XNode):
                self.emitNodeMenuRequested(item)
            else:
                self.emitMenuRequested()
            event.accept()
641752
@Override
	public void publish(Event event) {

		// Connected
		if (event instanceof ConnectedEvent) {
			if (status.compareAndSet(STATUS_CONNECTING_1, STATUS_CONNECTING_2)) {

				// First connection is Ok
				return;
			}
			if (status.compareAndSet(STATUS_CONNECTING_2, STATUS_CONNECTED)) {

				// Second connection is Ok
				logger.info("All Redis pub-sub connections estabilished.");
				connected(false);
			}
			return;
		}

		// Disconnected
		if (event instanceof DisconnectedEvent) {
			int s = status.getAndSet(STATUS_DISCONNECTED);
			if (s != STATUS_DISCONNECTED && s != STATUS_DISCONNECTING) {
				logger.info("Redis pub-sub connection aborted.");
				reconnect();
			}
		}

	}
1206250
private void onParticipantRemoved(ParticipantRemovedEvent event) {
        handler.post(() -> listener.onParticipantRemoved(event));
        log("Event published " + event.toString());
    }
132756
void publishOsgiEvent(org.osgi.service.event.Event event, boolean async) {
        String topic = event.getTopic();
        com.ibm.websphere.event.Event e = createEvent(topic);
        for (String key : event.getPropertyNames()) {
            e.setProperty(key, event.getProperty(key));
        }
        publishEvent(e, async);
    }
444301
public void publish(Object event) {
        Objects.requireNonNull(event, Required.EVENT.toString());
        
        this.eventBus.post(event);
        this.events.getAndIncrement();
    }
380140
def focusInEvent(self, event):
        
        if not self.signalsBlocked():
            self.focusChanged.emit(True)
            self.focusEntered.emit()
        
        return super(XTextEdit, self).focusInEvent(event)
206874
function broadcast(event, data, destination) {
        if (!crosstab.supported) {
            notSupported();
        }

        var message = {
            id: util.generateId(),
            event: event,
            data: data,
            destination: destination,
            origin: crosstab.id,
            timestamp: util.now()
        };

        // If the destination differs from the origin send it out, otherwise
        // handle it locally
        if (message.destination !== message.origin) {
            setLocalStorageItem(util.keys.MESSAGE_KEY, message);
        }

        if (!message.destination || message.destination === message.origin) {
            eventHandler.emit(event, message);
        }
    }
505491
def closeEvent(self, event):
        
        self.stop_process()
        self.backend.stop()
        try:
            self.modes.remove('_LinkHighlighter')
        except KeyError:
            pass  # already removed
        super(OutputWindow, self).closeEvent(event)
476045
public void publish(TaskEvent event) {
		synchronized (listeners) {
			for (EventListener<TaskEvent> listener : listeners.get(event.getClass())) {
				listener.onEvent(event);
			}
		}
	}
45900
def Publish(self, event_name, msg, delay=0):
    """"""
    events_lib.Events.PublishEvent(event_name, msg, delay=delay)
1082943
public function publish(Event $event)
    {
        foreach ($this->locator->listenersOfEvent($event) as $listener) {
            call_user_func($listener, $event);
        }
    }
405105
def mouseReleaseEvent(self, event):
        
        self.accept()
        super(XSnapshotWidget, self).mouseReleaseEvent(event)
649922
function emitEvent(emitter, event, data) {    
  process.nextTick(function() {
    emitter.emit(event, data);
  });
}