Use :meth:`NsqdTCPClient.publish` instead.

        .. deprecated:: 1.0.0
503764
def publish_tcp(self, topic, data, **kwargs):
        
        return self.__tcp_client.publish(topic, data, **kwargs)
1295858
def command_publish(self, command, **kwargs):
        
        mqttc = mqtt.Client()
        mqttc.connect(
            command['host'],
            port=int(command['port']))

        mqttc.loop_start()

        try:
            mqttc.publish(
                command['endpoint'],
                command['payload'])
        finally:
            mqttc.loop_stop(force=False)
252385
function publish(conn, channel, message) {
  var c = 0
    , indices = []
    , len
    , k
    , re;

  // exact channel match
  for(k in this._channels) {
    // found the channel
    if(k === channel) {
      indices = this._channels[k].slice(0);
      this.emit(
        PUBSUB.PUBLISH, conn, channel, indices,
          [PUBSUB.MESSAGE, channel, message]);
      break;
    }
  }

  len = indices.length;

  // reset indices for patterns
  // required to prevent channel subscribers
  // from also receiving pmessage events
  indices = [];

  // test against pattern channels
  for(k in this._patterns) {
    // pattern should be pre-compiled
    re = this._patterns[k].re;
    if(re.test(channel)) {
      indices = indices.concat(this._patterns[k]);
      this.emit(
        PUBSUB.PUBLISH, conn, channel, indices,
          [PUBSUB.PMESSAGE, k, channel, message]);
    }
  }

  len += indices.length;

  return len;
}
950494
def publish_message(host, amqp_settings, routing_key, data, async=False):
    
    global _thread
    global _num_pending

    kwargs = {
        "host": host,
        "amqp_settings": amqp_settings,
        "routing_key": routing_key,
        "data": data
    }

    if not async:
        return _publish_message(**kwargs)

    if _thread is None:
        with _lock:
            if _thread is None:
                _thread = threading.Thread(target=_publish_messages_async)
                _thread.daemon = True
                _thread.start()

    with _lock:
        _num_pending += 1

    _queue.put(kwargs)
    return True
113207
def publish(self, payload, **kwargs):
        
        publish_kwargs = self.publish_kwargs.copy()

        # merge headers from when the publisher was instantiated
        # with any provided now; "extra" headers always win
        headers = publish_kwargs.pop('headers', {}).copy()
        headers.update(kwargs.pop('headers', {}))
        headers.update(kwargs.pop('extra_headers', {}))

        use_confirms = kwargs.pop('use_confirms', self.use_confirms)
        transport_options = kwargs.pop('transport_options',
                                       self.transport_options
                                       )
        transport_options['confirm_publish'] = use_confirms

        delivery_mode = kwargs.pop('delivery_mode', self.delivery_mode)
        mandatory = kwargs.pop('mandatory', self.mandatory)
        priority = kwargs.pop('priority', self.priority)
        expiration = kwargs.pop('expiration', self.expiration)
        serializer = kwargs.pop('serializer', self.serializer)
        compression = kwargs.pop('compression', self.compression)
        retry = kwargs.pop('retry', self.retry)
        retry_policy = kwargs.pop('retry_policy', self.retry_policy)

        declare = self.declare[:]
        declare.extend(kwargs.pop('declare', ()))

        publish_kwargs.update(kwargs)  # remaining publish-time kwargs win

        with get_producer(self.amqp_uri,
                          use_confirms,
                          self.ssl,
                          transport_options,
                          ) as producer:
            try:
                producer.publish(
                    payload,
                    headers=headers,
                    delivery_mode=delivery_mode,
                    mandatory=mandatory,
                    priority=priority,
                    expiration=expiration,
                    compression=compression,
                    declare=declare,
                    retry=retry,
                    retry_policy=retry_policy,
                    serializer=serializer,
                    **publish_kwargs
                )
            except ChannelError as exc:
                if "NO_ROUTE" in str(exc):
                    raise UndeliverableMessage()
                raise

            if mandatory:
                if not use_confirms:
                    warnings.warn(
                        "Mandatory delivery was requested, but "
                        "unroutable messages cannot be detected without "
                        "publish confirms enabled."
                    )
1340251
def publish(self, topic, data, defer=None):
        
        nsq.assert_valid_topic_name(topic)
        fields = {'topic': topic}

        if defer is not None:
            fields['defer'] = '{}'.format(defer)

        return self._request('POST', '/pub', fields=fields, body=data)
71196
def publish(message_name, data=nil, opts={})
      message_name = validated_message_name(message_name)
      publisher.publish(message_name, data, opts)
    end
1266907
def publish(self, key, data):
        '''
        
        '''
        publish_data = {key: data}
        pub = salt.utils.json.dumps(publish_data) + str('\n\n')  # future lint: disable=blacklisted-function
        self.handler.write_message(pub)
225967
def publish(self, *args, **kwargs):
        '''
        
        '''
        if self.channel.confirm._enabled:
            self._msg_id += 1
        super(RabbitBasicClass, self).publish(*args, **kwargs)
        return self._msg_id
18164
def publish(self, message, exchange, routing_key, mandatory=None,
            immediate=None, headers=None):
        """"""
        body, properties = message

        if headers:
            properties.headers = headers

        ret = self.channel.basic_publish(body=body,
                                         properties=properties,
                                         exchange=exchange,
                                         routing_key=routing_key,
                                         mandatory=mandatory,
                                         immediate=immediate)
        if mandatory or immediate:
            self.close()
1308368
public void publish(int qos, String payload) throws ArtikCloudMqttException {
        MqttMessage mqttMessage = new MqttMessage(payload.getBytes());
        mqttMessage.setQos(qos);
//        System.out.println("****** Thread: " + Thread.currentThread().getName()+ "; MqttSession publishing : "+ "topic: " + publishTopic +"; payload: " + payload);
        try {
            mqttClient.publish(publishMessageTopicPath, mqttMessage, String.valueOf(OperationMode.PUBLISH), operationListener);
        } catch (MqttException e) {
            throw new ArtikCloudMqttException(e);
        }
    }
1005448
def _publish_connection(self, name=None):
        
        try:
            conn = self._connections[name or self._message.connection]
        except KeyError:
            raise ValueError('Channel {} not found'.format(name))
        if not conn.is_connected or conn.channel.is_closed:
            raise RabbitMQException(conn.name, 599, 'NOT_CONNECTED')
        return conn
1205271
def publish!
      current_time = Time.current
      update_columns(
        published_at: current_time,
        public_on: already_public_for?(current_time) ? public_on : current_time,
        public_until: still_public_for?(current_time) ? public_until : nil
      )
    end
411049
def publish(self, message_type, client_id, client_storage, *args, **kwargs):
        
        if self.connection.connected:
            message = self.exchange.Message(
                self.pack(message_type, client_id, client_storage, args, kwargs))
            self.exchange.publish(message, routing_key='')
1025015
def publish(self, dataset_identifier, content_type="json"):
        '''
        
        '''
        base = _format_old_api_request(dataid=dataset_identifier)
        resource = "{0}/publication.{1}".format(base, content_type)

        return self._perform_request("post", resource)
1298544
def publish(self, load):
        '''
        
        '''
        payload = {'enc': 'aes'}

        crypticle = salt.crypt.Crypticle(self.opts, salt.master.SMaster.secrets['aes']['secret'].value)
        payload['load'] = crypticle.dumps(load)
        if self.opts['sign_pub_messages']:
            master_pem_path = os.path.join(self.opts['pki_dir'], 'master.pem')
            log.debug("Signing data packet")
            payload['sig'] = salt.crypt.sign_message(master_pem_path, payload['load'])
        # Use the Salt IPC server
        if self.opts.get('ipc_mode', '') == 'tcp':
            pull_uri = int(self.opts.get('tcp_master_publish_pull', 4514))
        else:
            pull_uri = os.path.join(self.opts['sock_dir'], 'publish_pull.ipc')
        # TODO: switch to the actual asynchronous interface
        #pub_sock = salt.transport.ipc.IPCMessageClient(self.opts, io_loop=self.io_loop)
        pub_sock = salt.utils.asynchronous.SyncWrapper(
            salt.transport.ipc.IPCMessageClient,
            (pull_uri,)
        )
        pub_sock.connect()

        int_payload = {'payload': self.serial.dumps(payload)}

        # add some targeting stuff for lists only (for now)
        if load['tgt_type'] == 'list':
            if isinstance(load['tgt'], six.string_types):
                # Fetch a list of minions that match
                _res = self.ckminions.check_minions(load['tgt'],
                                                    tgt_type=load['tgt_type'])
                match_ids = _res['minions']

                log.debug("Publish Side Match: %s", match_ids)
                # Send list of miions thru so zmq can target them
                int_payload['topic_lst'] = match_ids
            else:
                int_payload['topic_lst'] = load['tgt']
        # Send it over IPC!
        pub_sock.send(int_payload)
777865
def publish (self):
        '''
         
        '''
        self.lock.acquire()
        tw = cmdvel2Twist(self.data)
        self.lock.release()
        self.pub.publish(tw)