Push a message to a subscription socket.
161095
public function push()
	{
		if(isset($this->broadcast) && ! is_null($this->broadcast))
		{
			// Connect to socket server.
			$this->connect();

			// Send the message through the socket.
		    $this->socket->send(json_encode($this->broadcast));
		}
	}
1046054
def subscribe(ws):
    """"""
    while ws is not None:
        gevent.sleep(0.1)
        try:
            message = ws.receive()  # expect function name to subscribe to
            if message:
                stream.register(ws, message)
        except WebSocketError:
            ws = None
1006715
def publish(self, message):
        
        props = pika.BasicProperties(content_type='text/plain', delivery_mode=1)
        self.channel.basic_publish(self._exchange,
                                   self._routing_key,
                                   message,
                                   props)
464287
def push(self, message, callback_arg=None):
        

        if message['action'] == 'upsert':
            message.setdefault('key_names', self.key_names)

        message['client_id'] = self.client_id
        message.setdefault('table_name', self.table_name)

        self._add_message(message, callback_arg)

        batch = self._take_batch(self.target_messages_per_batch)
        if batch:
            self._send_batch(batch)
633235
def subscribe(self, stream_type, **parameters):
        """"""
        parameters["stream_type"] = stream_type

        if (stream_type == "result") and ("buffering" not in parameters):
            parameters["buffering"] = True

        self.socketIO.emit(self.EVENT_NAME_SUBSCRIBE, parameters)
700144
def subscribe_to_chat(
        self,
        subscriber: Callable[[events.ChatMessageWasReceived], None],
    ) -> None:
        
        self._chat_subscribers.append(subscriber)
819317
def incoming(message, callback)
      if message['channel'] == '/meta/subscribe'
        authenticate_subscribe(message)
      elsif message['channel'] !~ %r{^/meta/}
        authenticate_publish(message)
      end
      callback.call(message)
    end
135872
def send_message(self, id_service, content):
        """"""
        if not content:
            return
        with self._lock:
            try:
                message = "Message: %s to %s" % (content, id_service)
                self.write_message(message)
                self.stream.flush()  # flush after each message
                return "message_id"
            except Exception:
                if not self.fail_silently:
                    raise
132499
def send(self, message_data, delivery_mode=None):
        """"""
        self.publisher.send(message_data, delivery_mode=delivery_mode)
1027291
def start_subscribe(self):
        """"""
        if not self.conn:
            raise ValueError('Not connected')
        elif not self.pubsub_conn:
            raise ValueError('PubSub not enabled')

        # creates a new context manager
        return Subscription(self)
750359
function(message) {
			var response = new DataResponse(message, subscribe, subscribeError);
			if (queueSubUnsubRequest(message, response) === 1) {
				fireFirstSubUnsubEvent(message.itemName);
			} else {
				that.emit("subscribeInQueue", message.itemName);
			}
		}
869826
async def rpc_message(self, request, message):
        ''''''
        await self.pubsub.publish(self.channel, message)
        return 'OK'
525636
protected void pushMessage(StatusMessage msg) {
        if (connMsgOut != null) {
            try {
                connMsgOut.pushMessage(msg);
            } catch (IOException err) {
                log.error("Error while pushing message: {}", msg, err);
            }
        } else {
            log.warn("Consumer message output is null");
        }
    }
151115
def pub_msg(self, msg):
        """"""
        topic = msg.get('topic')
        self.pub_socket.send_multipart(
            [pickle.dumps(topic), pickle.dumps(msg)])

        for h in self._handle_funcs.get(topic, []):
            h(msg)
25636
async def _on_message(self, update):
        """"""

        name = update['service']
        message_obj = update['payload']

        if name not in self.services:
            return

        with self._state_lock:
            self.services[name].post_message(message_obj['level'], message_obj['message'])
1067800
def subscribe(self, topic, channel):
        """"""
        self.send(nsq.subscribe(topic, channel))
1291141
public void pushMessage(IMessage message) throws IOException {
        if (log.isDebugEnabled()) {
            log.debug("pushMessage: {} to {} consumers", message, consumers.size());
        }
        for (IConsumer consumer : consumers) {
            try {
                ((IPushableConsumer) consumer).pushMessage(this, message);
            } catch (Throwable t) {
                if (t instanceof IOException) {
                    throw (IOException) t;
                }
                log.error("Exception pushing message to consumer", t);
            }

        }
    }