Publish an event
        :param event: Event object
359533
async def emit_event(self, event):
        
        self.log.info("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

        await asyncio.sleep(1)
327619
public void fireEvent(Object publisher, FireAfterTransaction events) throws RuntimeException {
        try {
            for (int i = 0; i < events.events().length; i++) {
                Class<? extends EventObject> event = events.events()[i];
                if (ApplicationEvent.class.isAssignableFrom(event)) {
                    ctx.publishEvent((ApplicationEvent) event.getConstructor(Object.class).newInstance(publisher));
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
476045
public void publish(TaskEvent event) {
		synchronized (listeners) {
			for (EventListener<TaskEvent> listener : listeners.get(event.getClass())) {
				listener.onEvent(event);
			}
		}
	}
560581
private void publishEvent(WSJobInstance objectToPublish, String eventToPublish) {

        if (getBatchEventsPublisher() != null) {
            getBatchEventsPublisher().publishJobInstanceEvent(objectToPublish, eventToPublish, correlationId);
        }
    }
672153
def new_event(event):
    
    op_name = event.EventType.DESCRIPTOR.values_by_number[event.type].name
    if op_name == 'PUT':
        cls = PutEvent
    elif op_name == 'DELETE':
        cls = DeleteEvent
    else:
        raise Exception('Invalid op_name')

    return cls(event)
383378
def emit(self, event):
        
        if hasattr(event, 'time'):
            event.step_size = self.manager.step_size()
            event.time = self.manager.clock() + self.manager.step_size()

        for priority_bucket in self.listeners:
            for listener in sorted(priority_bucket, key=lambda x: x.__name__):
                listener(event)
        return event
322763
public function publish(Event $event)
    {
        $massage = $this->serializer->serialize($event);
        $this->client->publish($this->queue_name, $massage);

        return true;
    }
567669
def post_event(self, event):
        

        if self.disabled is True:
            logging.error('Posting has been disabled. '
                          'See previous errors for details.')
            return(False)

        payload = json.dumps(
            [event], default=lambda o: o.__dict__, sort_keys=True)
        logging.debug(payload)
        try:
            headers = {'Content-Type': 'application/json',
                       'User-Agent': self.agent}
            request = urllib2.Request(
                self.eventurl, data=payload, headers=headers)
            resp = urllib2.urlopen(request)
            logging.debug("Response code: %d", resp.getcode())
            resp.close()

            return(True)

        except urllib2.HTTPError as e:
            logging.debug("Response code: %d", e.code)

            if e.code in self.kill_codes:
                self.disabled = True
                logging.exception('Posting has been disabled.'
                                  'See previous errors for details.')
            else:
                logging.exception(
                    'error posting payload to api ingest endpoint (%s): %s',
                    self.eventurl, e)

        except Exception as e:
            logging.exception(
                'error posting payload to api ingest endpoint (%s): %s',
                self.eventurl, e)
700702
private void publishPurgeEvent(WSJobInstance jobInstance) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobInstanceEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_PURGED, null);
        }
    }
576564
def publish_event_from_dict(self, event_type, data):
        
        for key, value in self.additional_publish_event_data.items():
            if key in data:
                return {'result': 'error', 'message': 'Key should not be in publish_event data: {}'.format(key)}
            data[key] = value

        self.runtime.publish(self, event_type, data)
        return {'result': 'success'}
9363
def emit(self, event, *args, **kwargs):
        
        for func in self._registered_events[event].values():
            func(*args, **kwargs)
541210
def write_event(self, event):
        

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

        event.write_to(self._out)
462146
protected void doPublishEvent(final ApplicationEvent e) {
        if (applicationEventPublisher != null) {
            LOGGER.trace("Publishing [{}]", e);
            this.applicationEventPublisher.publishEvent(e);
        }
    }
945533
@Override
    public void publishEvent(FacesContext context,
                             Class<? extends SystemEvent> systemEventClass,
                             Object source) {
        getWrapped().publishEvent(context, systemEventClass, source);
    }
1038504
function publishEvent( channelName, eventObj ) {
  var broker = getEventBroker( 'main' )
  eventObj.channel = channelName
  broker.publish( eventObj ); 
}
704152
def publish(self, topic, obj, reference_message=None):
        
        logging.debug("Publishing topic (%s): \n%s" % (topic, obj))
        e = Event(
            data=obj,
            type=topic,
        )
        if hasattr(obj, "sender"):
            e.sender = obj.sender

        if reference_message:
            original_incoming_event_hash = None
            if hasattr(reference_message, "original_incoming_event_hash"):
                original_incoming_event_hash = reference_message.original_incoming_event_hash
            elif hasattr(reference_message, "source") and hasattr(reference_message.source, "hash"):
                original_incoming_event_hash = reference_message.source.hash
            elif hasattr(reference_message, "source") and hasattr(reference_message.source, "original_incoming_event_hash"):
                original_incoming_event_hash = reference_message.source.original_incoming_event_hash
            elif hasattr(reference_message, "hash"):
                original_incoming_event_hash = reference_message.hash
            if original_incoming_event_hash:
                e.original_incoming_event_hash = original_incoming_event_hash

        return self.publish_to_backend(
            self._localize_topic(topic),
            self.encrypt(e)
        )
470028
def emit(self, event, *args, **kwargs):
        
        self._emit(event, self, *args, **kwargs)