Publish publishes the data argument to the given subject.

        Args:
            duration (float): will wait for the given number of seconds
            count (count): stop of wait after n messages from any subject
482731
def wait(self, duration=None, count=0):
        
        start = time.time()
        total = 0
        while True:
            type, result = self._recv(MSG, PING, OK)
            if type is MSG:
                total += 1
                if self._handle_msg(result) is False:
                    break

                if count and total >= count:
                    break

            elif type is PING:
                self._handle_ping()

            if duration and time.time() - start > duration:
                break
965047
def publish(self, object_id: str, event_type: str,
                event_data: dict = None):
        
        object_key = SchedulingObject.get_key(self.type, object_id)
        publish(event_type=event_type,
                event_data=event_data,
                object_type=self.type,
                object_id=object_id,
                object_key=object_key,
                origin=None)
621604
def publish_synchronous(self, *args, **kwargs):
        '''
        
        '''
        cb = kwargs.pop('cb', None)
        self.tx.select()
        self.basic.publish(*args, **kwargs)
        self.tx.commit(cb=cb)
747011
private void sendRegisterRequest() {
    Metrics.MetricPublisher publisher = Metrics.MetricPublisher.newBuilder().
        setHostname(hostname).
        setPort(instance.getInfo().getTaskId()).
        setComponentName(instance.getInfo().getComponentName()).
        setInstanceId(instance.getInstanceId()).
        setInstanceIndex(instance.getInfo().getComponentIndex()).
        build();
    Metrics.MetricPublisherRegisterRequest request =
        Metrics.MetricPublisherRegisterRequest.newBuilder().
            setPublisher(publisher).
            build();

    // The timeout would be the reconnect-interval-seconds
    sendRequest(request, null,
        Metrics.MetricPublisherRegisterResponse.newBuilder(),
        systemConfig.getInstanceReconnectMetricsmgrInterval());
  }
179374
def publish_time(self):
        
        timestamp = self._message.publish_time
        delta = datetime.timedelta(
            seconds=timestamp.seconds, microseconds=timestamp.nanos // 1000
        )
        return datetime_helpers._UTC_EPOCH + delta
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
618981
def publish(self, topic, message):
        
        if not self.connections:
            raise NSQNoConnections()
        conn = random.choice(list(self.connections))
        conn.publish(topic, message)
1101879
protected void doPublish(String tenantId, List<T> items, String subscriber,
            int retryCount, long delay) throws Exception {
        String data = mapper.writeValueAsString(items);

        TextMessage tm = session.createTextMessage(data);

        if (tenantId != null) {
            tm.setStringProperty("tenant", tenantId);
        }

        if (subscriber != null) {
            tm.setStringProperty("subscriber", subscriber);
        }

        tm.setIntProperty("retryCount", retryCount);

        if (delay > 0) {
            tm.setLongProperty("_AMQ_SCHED_DELIVERY", System.currentTimeMillis() + delay);
        }

        if (log.isLoggable(Level.FINEST)) {
            log.finest("Publish: " + tm);
        }

        producer.send(tm);
    }
751579
def publish(self, msg):
        
        self.pub.send("{} {}".format(self.name, msg))
        log.debug('Published message from {}'.format(self))
989859
def publish(self, message_type=ON_SEND, client_id=None, client_storage=None,
                *args, **kwargs):
        
        self.publisher.publish(
            message_type, client_id, client_storage, *args, **kwargs)
724951
@Override
	public final void publish(Topic topic, Message message) throws JMSException
    {
        send(topic,message);
    }
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)
45900
def Publish(self, event_name, msg, delay=0):
    """"""
    events_lib.Events.PublishEvent(event_name, msg, delay=delay)
1004708
def publish(self, message):
        
        message_data = self._to_data(message)
        self._encode_invoke(topic_publish_codec, message=message_data)
988698
def publishing(self, service):
        
        # flag to know if we have to update
        to_update = False
        # flag to get the status of a service
        status = False
        # provider - the service that offer data
        # check if the service has already been triggered
        # if date_triggered is None, then it's the first run
        if service.date_triggered is None:
            logger.debug("first run {}".format(service))
            to_update = True
            status = True
        # run run run
        data = self.provider(service)
        count_new_data = len(data) if data else 0
        if count_new_data > 0:
            to_update, status = self.consumer(service, data, to_update, status)
            # let's log
        self.log_update(service, to_update, status, count_new_data)
        # let's update
        if to_update and status:
            self.update_trigger(service)
776618
def publish(self, channel: str, value: Any):
        
        self._r.publish(channel, str(value))
374831
def publish(self, topic, *args, **kwargs):
        
        assert topic is not None

        params = {
            "topic": topic,
            "args": args,
            "kwargs": kwargs
        }

        response = self._make_api_call("POST", self.url, json_params=params)
        return response["id"]