Publishes each saved message to Centrifugo.
10172
def publish_message_to_centrifugo(sender, instance, created, **kwargs):
    
    if created is True:
        client = Client("{0}api/".format(getattr(settings, "CENTRIFUGE_ADDRESS")), getattr(settings, "CENTRIFUGE_SECRET"))
        # we ensure the client is still in the thread (he may have left or have been removed)
        active_participants = [participation.participant.id for participation in Participation.objects.filter(thread=instance.thread, date_left__isnull=True).select_related('participant')]
        client.publish(
            build_channel(settings.CENTRIFUGO_MESSAGE_NAMESPACE, instance.thread.id, active_participants),
            {
                "id": instance.id,
                "body": instance.body,
                "sender": instance.sender.id,
                "thread": instance.thread.id,
                "sent_at": str(instance.sent_at),
                "is_notification": True,  # ATTENTION: check against sender too to be sure to not notify him his message
            }
        )
239701
function publishCachedMessages() {
    if (_cachedPublishMessages.length > 0) {
      async.each(_cachedPublishMessages, function(message, callback) {
        debug('republish message', message);
        self.publishTopic(message.exchange, message.topic, message.message, message.options, function(err) {
          if (err) {
            debug('Failed to republish message', message);
          } else {
            var idx = _cachedPublishMessages.indexOf(message);
            _cachedPublishMessages.splice(idx, 1);
            debug('cached publish message re-published, now there are ' + _cachedPublishMessages.length + ' messages left');
          }
          return callback();
        });
      }, function() {
        debug('cached publish messages processed');
      });
    }
  }
1365877
private void onParticipantAdded(ParticipantAddedEvent event) {
        handler.post(() -> listener.onParticipantAdded(event));
        log("Event published " + event.toString());
    }
1034437
@Override
	public void publish(Message message) throws JMSException
    {
        send(message,defaultDeliveryMode,defaultPriority,defaultTimeToLive);
    }
1281103
public function publishTimedRecords()
    {
        foreach ($this->contentTypeNames as $contentTypeName) {
            $this->timedHandleRecords($contentTypeName, 'timed');
        }
        $this->cache->save(self::CACHE_KEY_PUBLISH, true, $this->interval);
    }
324397
protected function saveMessage()
    {
        $this->savedMessage = ['headers' => []];
        $this->savedMessage['body'] = $this->getBody();
        $this->savedMessage['children'] = $this->getChildren();
        if (count($this->savedMessage['children']) > 0 && '' != $this->getBody()) {
            $this->setChildren(array_merge([$this->becomeMimePart()], $this->savedMessage['children']));
            $this->setBody('');
        }
    }
132499
def send(self, message_data, delivery_mode=None):
        """"""
        self.publisher.send(message_data, delivery_mode=delivery_mode)
202746
def publish(self, topic, message):
        """"""
        self.connect()
        log.info('publish {}'.format(message))
        self.client.publish(topic, message)
1173371
def publish_participation_to_thread(sender, instance, created, **kwargs):
    
    if kwargs.get('created_and_add_participants') is True:
        request_participant_id = kwargs.get('request_participant_id')
        if request_participant_id is not None:
            client = Client("{0}api/".format(getattr(settings, "CENTRIFUGE_ADDRESS")), getattr(settings, "CENTRIFUGE_SECRET"))
            active_participants = [participation.participant for participation in Participation.objects.filter(thread=instance, date_left__isnull=True).select_related('participant')]
            for participant in active_participants:
                client.publish(
                    build_channel(settings.CENTRIFUGO_THREAD_NAMESPACE, participant.id, [participant.id]),
                    {
                        "message_channel_to_connect_to": build_channel(settings.CENTRIFUGO_MESSAGE_NAMESPACE, instance.id, [p.id for p in active_participants])
                    }
                )
1209552
private void publishEndedEvent() {
        BatchEventsPublisher publisher = getBatchEventsPublisher();
        if (publisher != null) {

            publisher.publishSplitFlowEvent(getSplitName(),
                                            getFlowName(),
                                            getTopLevelInstanceId(),
                                            getTopLevelExecutionId(),
                                            BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_ENDED,
                                            correlationId);
        }
    }
1334153
def publish(self, message, key=None, **kws):
        """"""
        return PSPut(self, message, key, **kws)
1220978
def multipublish(self, topic, messages):
        
        self.send(nsq.multipublish(topic, messages))
1125264
private PubsubFuture<List<String>> publish0(final List<Message> messages, final String canonicalTopic) {
    final String path = canonicalTopic + ":publish";
    for (final Message message : messages) {
      if (!isEncoded(message)) {
        throw new IllegalArgumentException("Message data must be Base64 encoded: " + message);
      }
    }
    return post("publish", path, PublishRequest.of(messages), readJson(PublishResponse.class)
        .andThen(PublishResponse::messageIds));
  }
990083
def save(self):
        """"""
        response = self.session.request("save:Message", [ self.data ])
        self.data = response
        self.message_id = self.data["id"]
        return self
817213
public function saveToFile()
    {
        $emails = $this->getEmailTemplatesFromRepository()->toJson();

        $this->filesystem->put($this->storagePath, $emails);
    }
656981
def publish!(topic, subtopic, schema, partition_key, payload)
      event = Event.new(topic, subtopic, origin, schema, partition_key, payload)
      raise MegaphoneInvalidEventError.new(event.errors.join(', ')) unless event.valid?
      unless logger.post(topic, event.to_hash)
        if transient_error?(logger.last_error)
          raise MegaphoneMessageDelayWarning.new(logger.last_error.message, event.stream_id)
        else
          raise MegaphoneUnavailableError.new(logger.last_error.message, event.stream_id)
        end
      end
    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='')