Publish a Pulse Message

        Publish a message on pulse with the given `routingKey`.

        This method takes input: ``v1/pulse-request.json#``

        This method is ``experimental``
161202
async def pulse(self, *args, **kwargs):
        

        return await self._makeApiCall(self.funcinfo["pulse"], *args, **kwargs)
814005
def publish(self, channel, message):
        
        if self.cfg.jsonpickle:
            message = jsonpickle.encode(message)
        return self.conn.publish(channel, message)
202746
def publish(self, topic, message):
        """"""
        self.connect()
        log.info('publish {}'.format(message))
        self.client.publish(topic, message)
872719
def store_pulse_jobs(pulse_job, exchange, routing_key):
    
    newrelic.agent.add_custom_parameter("exchange", exchange)
    newrelic.agent.add_custom_parameter("routing_key", routing_key)

    JobLoader().process_job(pulse_job)
619175
def publish(self,topic,options=None,args=None,kwargs=None):
        
        topic = self.get_full_uri(topic)
        if options is None:
            options = {'acknowledge':True}
        if options.get('acknowledge'):
            request = PUBLISH(
                        options=options or {},
                        topic=topic,
                        args=args or [],
                        kwargs=kwargs or {}
                      )
            result = self.send_and_await_response(request)
            return result
        else:
            request = PUBLISH(
                        options=options or {},
                        topic=topic,
                        args=args or [],
                        kwargs=kwargs or {}
                      )
            self.send_message(request)
            return request.request_id
1142379
def publish(topic, payload = '', retain = false, qos = 0)
      raise ArgumentError, 'Topic name cannot be nil' if topic.nil?
      raise ArgumentError, 'Topic name cannot be empty' if topic.empty?

      packet = MQTT::Packet::Publish.new(
        :id => next_packet_id,
        :qos => qos,
        :retain => retain,
        :topic => topic,
        :payload => payload
      )

      # Send the packet
      res = send_packet(packet)

      return if qos.zero?

      Timeout.timeout(@ack_timeout) do
        while connected?
          @pubacks_semaphore.synchronize do
            return res if @pubacks.delete(packet.id)
          end
          # FIXME: make threads communicate with each other, instead of polling
          # (using a pipe and select ?)
          sleep 0.01
        end
      end

      -1
    end
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()
734088
def _publish_response(self, slug, message):
        

        resp_topic = self.topics.gateway_topic(slug, 'data/response')
        self._logger.debug("Publishing response message: (topic=%s) (message=%s)", resp_topic, message)
        self.client.publish(resp_topic, message)
632585
def process(self, metric):
        
        # Send the data as ......
        if not pika:
            return

        routingKeyDic = {
            'metric': lambda: metric.path,
            'custom': lambda: self.custom_routing_key,

            # These option and the below are really not needed because
            #  with Rabbitmq you can use regular expressions to indicate
            #  what routing_keys to subscribe to. But I figure this is
            #  a good example of how to allow more routing keys

            'host': lambda: metric.host,
            'metric.path': metric.getMetricPath,
            'path.prefix': metric.getPathPrefix,
            'collector.path': metric.getCollectorPath,
        }

        try:
            self.channel.basic_publish(
                exchange=self.topic_exchange,
                routing_key=routingKeyDic[self.routing_key](),
                body="%s" % metric)

        except Exception:  # Rough connection re-try logic.
            self.log.info(
                "Failed publishing to rabbitMQ. Attempting reconnect")
            self._bind()
1038614
def _publish_queue_grpc(self):
        
        messages = EventHub_pb2.Messages(msg=self._tx_queue)
        publish_request = EventHub_pb2.PublishRequest(messages=messages)
        self.grpc_manager.send_message(publish_request)
1195993
public function publish(string $message, string $routing_key = 'default')
    {
        return $this->amqpExchange->publish($message, $routing_key);
    }
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
611656
def publish
      publisher.publish('instance', added: info) do |redis|
        redis.setex "instance_#{ @id }", Attention.options[:ttl], JSON.dump(info)
      end
      heartbeat
    end
1320612
public void publish(Channel channel, DeliveryOptions deliveryOptions) throws IOException {
        // Assure to have a timestamp
        if (basicProperties.getTimestamp() == null) {
            basicProperties.builder().timestamp(new Date());
        }

        boolean mandatory = deliveryOptions == DeliveryOptions.MANDATORY;
        boolean immediate = deliveryOptions == DeliveryOptions.IMMEDIATE;

        LOGGER.info("Publishing message to exchange '{}' with routing key '{}' (deliveryOptions: {}, persistent: {})",
                new Object[] { exchange, routingKey, deliveryOptions, basicProperties.getDeliveryMode() == 2 });

        channel.basicPublish(exchange, routingKey, mandatory, immediate, basicProperties, bodyContent);
        LOGGER.info("Successfully published message to exchange '{}' with routing key '{}'", exchange, routingKey);
    }
225206
def send_message(exchange, routing_key, message, options)
      message_options = options.merge({:routing_key => routing_key})
      message = message.to_json
      EventMachine.next_tick do
        exchange.publish message, message_options
      end
    end
869826
async def rpc_message(self, request, message):
        ''''''
        await self.pubsub.publish(self.channel, message)
        return 'OK'
1265955
public boolean publish(String topicName, DefaultMessage message,boolean asynSend){
		if(routeEnv != null)topicName = routeEnv + "." + topicName;
		return producer.publish(topicName, message,asynSend);
	}