Trigger an event on this channel.  Only available for private or
        presence channels

        :param event_name: The name of the event.  Must begin with 'client-''
        :type event_name: str

        :param data: The data to send with the event.
359582
def trigger(self, event_name, data):
        
        if self.connection:
            if event_name.startswith("client-"):
                if self.name.startswith("private-") or self.name.startswith("presence-"):
                    self.connection.send_event(event_name, data, channel_name=self.name)
278341
def bind(self, event_name, callback, *args, **kwargs):
        
        self.event_callbacks[event_name].append((callback, args, kwargs))
1025605
async def _trigger_event(self, event, *args, **kwargs):
        """"""
        run_async = kwargs.pop('run_async', False)
        ret = None
        if event in self.handlers:
            if asyncio.iscoroutinefunction(self.handlers[event]) is True:
                if run_async:
                    return self.start_background_task(self.handlers[event],
                                                      *args)
                else:
                    try:
                        ret = await self.handlers[event](*args)
                    except asyncio.CancelledError:  # pragma: no cover
                        pass
                    except:
                        self.logger.exception(event + ' async handler error')
                        if event == 'connect':
                            # if connect handler raised error we reject the
                            # connection
                            return False
            else:
                if run_async:
                    async def async_handler():
                        return self.handlers[event](*args)

                    return self.start_background_task(async_handler)
                else:
                    try:
                        ret = self.handlers[event](*args)
                    except:
                        self.logger.exception(event + ' handler error')
                        if event == 'connect':
                            # if connect handler raised error we reject the
                            # connection
                            return False
        return ret
966870
def trigger(self, event: str, **kwargs: Any) -> None:
        """"""
        event = event.upper()
        for func in self._event_handlers[event]:
            self.loop.create_task(func(**kwargs))
        # This will unblock anyone that is awaiting on the next loop update,
        # while still ensuring the next `await client.wait(event)` doesn't
        # immediately fire.
        async_event = self._events[event]
        async_event.set()
        async_event.clear()
64456
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

        loop = asyncio.get_event_loop()
        producer = AIOKafkaProducer(
            loop=loop,
            bootstrap_servers=self.transport_host
        )
        await producer.start()

        try:
            event = json.dumps(event.__dict__).encode()
            await producer.send_and_wait(
                self.publish_topic,
                event
            )
        finally:
            await producer.stop()
1365030
def events_client(self, client):
        
        # TODO Add paging to this
        client = self._client_id(client)
        response = self._get(url.events_clients_id.format(id=client))
        self._check_response(response, 200)
        return self._create_response(response).get("events")
421550
def make_event_data(self, flavor, data):
        
        if not flavor.startswith('_'):
            raise ValueError('Event flavor must start with _underscore')

        d = {'source': {'space': self._event_space, 'id': self._source_id}}
        d.update(data)
        return {flavor: d}
1044032
def event(self, name):
        
        events = self.events()
        if name not in events:
            events[name] = Event(name, self, 0)
        return events[name]
407159
def pool_create_event(self, pool_info):
        
        pool_data = pool_info.get('pool')
        listeners = pool_data.get('listeners')
        for listener in listeners:
            l_id = listener.get('id')
            l_info = self.neutronclient.show_listener(l_id)
            self.listener_create_event(l_info)
1022406
function bridgeListener(channelName, data) {
  if (channels.hasOwnProperty(channelName)) {
    channels[channelName].processData(data);
  } else {
    console.error('ERROR: Channel not found:', channelName);
  }
}
1017875
def event(self, name, owner=None, **kwargs):
        
        return Event(self.tcex, name, owner=owner, **kwargs)
615321
function(el, eventName, data)
    {
        var ev;

        if (document.createEvent) {
            ev = document.createEvent('HTMLEvents');
            ev.initEvent(eventName, true, false);
            ev = extend(ev, data);
            el.dispatchEvent(ev);
        } else if (document.createEventObject) {
            ev = document.createEventObject();
            ev = extend(ev, data);
            el.fireEvent('on' + eventName, ev);
        }
    }
400829
def trigger_incident(self, service_key, description,
                         incident_key=None, details=None,
                         client=None, client_url=None, contexts=None):
        

        return self.create_event(service_key, description, "trigger",
                                 details, incident_key,
                                 client=client, client_url=client_url, contexts=contexts)
705611
def create_event(data):
        
        event = riemann_client.riemann_pb2.Event()
        event.host = socket.gethostname()
        event.tags.extend(data.pop('tags', []))

        for key, value in data.pop('attributes', {}).items():
            attribute = event.attributes.add()
            attribute.key, attribute.value = key, value

        for name, value in data.items():
            if value is not None:
                setattr(event, name, value)
        return event
1125984
async def emit(self, name):
        
        for cb in self._event_list[name]:
            if isawaitable(cb):
                await cb
            else:
                cb()
1182345
def handle_publish(client, data)
      topic_uri, payload, exclude, include = data

      @engine.create_event(client, topic_uri, payload, exclude, include)

      trigger(:publish, client, topic_uri, payload, exclude, include)
    end
482238
def on_namreply(self, connection, event):
        
        for nickname in event.arguments()[-1].split():
            nickname = nickname.lstrip("@+")
            self.nicknames[nickname] = color(nickname)
        self.emit_nicknames()