Publish a new ``event`` on a ``channel``

        :param channel: channel name
        :param event: event name
        :param data: optional payload to include in the event
        :return: a coroutine and therefore it must be awaited
970908
async def publish(self, channel, event, data=None):
        
        msg = {'event': event, 'channel': channel}
        if data:
            msg['data'] = data
        try:
            await self.pubsub.publish(self.prefixed(channel), msg)
        except ConnectionRefusedError:
            self.connection_error = True
            self.logger.critical(
                '%s cannot publish on "%s" channel - connection error',
                self,
                channel
            )
        else:
            self.connection_ok()
1097304
def push(self, channel_id, data):
        

        channel_path = self.channel_path(channel_id)
        response = requests.post(channel_path, data)

        return response.json()
1219424
def send_to_pipe_channel(channel_name,
                         label,
                         value):
    ''
    async_to_sync(async_send_to_pipe_channel)(channel_name=channel_name,
                                              label=label,
                                              value=value)
105726
def cmd_join(self, connection, sender, target, payload):
        
        if payload:
            connection.join(payload)
        else:
            raise ValueError("No channel given")
472983
function publish(channel, data, clientID) {
  if (clientID) {
    channel += '/' + clientID;
  }
  fayeClient.publish(channel, data);
}
334325
def _process_content_header(self, channel, payload):
        
        partial = self.partial_messages[channel]
        partial.add_header(payload)

        if partial.complete:
            #
            # a bodyless message, we're done
            #
            self.queue.put((channel, partial.method_sig, partial.args, partial.msg))
            del self.partial_messages[channel]
            self.expected_types[channel] = 1
        else:
            #
            # wait for the content-body
            #
            self.expected_types[channel] = 3
363559
def _connection_handler(self, event_name, data, channel_name):
        
        if channel_name in self.channels:
            self.channels[channel_name]._handle_event(event_name, data)
39119
def post_channel(self, channel_id, message):
        
        headers = {"Authorization": "Bearer " + self.token}
        props = {'channel_id': channel_id, 'message': message}
        p = requests.post(self.url + '/posts', headers=headers, data=json.dumps(props))
        return p
224915
function emitToEveryone(channelName, data) {
        Object.keys(io.sockets.sockets).filter(function (key) {
            return !!io.sockets.sockets[key].transomUser;
        }).map(function (socketKey) {
            io.sockets.sockets[socketKey].emit(channelName, data);
        });
    }
9363
def emit(self, event, *args, **kwargs):
        
        for func in self._registered_events[event].values():
            func(*args, **kwargs)
532471
def create_channel(self, channel):
        

        data = {'channels': channel}
        return super(ApiInterfaceRequest, self).post('api/v3/channel/', data)
1354072
def update_channel(self, channel):
        

        data = {'channels': channel}
        return super(ApiInterfaceRequest, self).put('api/v3/channel/', data)
139193
def publish(channel, value)
      redis = Attention.redis.call
      yield redis if block_given?
      redis.publish channel, payload_for(value)
    end
677399
function dispatchEvent (event, data) {
    if (hasDOM()) {
      eventEmitter.dispatchEvent(new CustomEvent(event, data));
    } else if (hasEventEmitter()) {
      eventEmitter.emit(event, data);
    }
  }
1274401
def on_open(self, websocket):
        ''''''
        self.pubsub.add_client(ChatClient(websocket, self.channel))
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)
1295919
def open_channel(self):
        
        logger.debug('Creating new channel')
        self._connection.channel(on_open_callback=self.on_channel_open)