Publish some payload to server.
330498
def publish(self, topic, payload = None, qos = 0, retain = False):
        """"""
        #print "PUBLISHING (",topic,"): ", payload
        payloadlen = len(payload)
        if topic is None or qos < 0 or qos > 2:
            print "PUBLISH:err inval"
            return NC.ERR_INVAL
        
        #payloadlen <= 250MB
        if payloadlen > (250 * 1024 * 1204):
            self.logger.error("PUBLISH:err payload len:%d", payloadlen)
            return NC.ERR_PAYLOAD_SIZE
        
        #wildcard check : TODO
        mid = self.mid_generate()
        
        if qos in (0,1,2):
            return self.send_publish(mid, topic, payload, qos, retain, False)

        else:
            self.logger.error("Unsupport QoS= %d", qos)
    
        return NC.ERR_NOT_SUPPORTED
1104760
def publish(self, data):
        
        if self.entity_api_key == "":
            return {'status': 'failure', 'response': 'No API key found in request'}
        publish_url = self.base_url + "api/0.1.0/publish"
        publish_headers = {"apikey": self.entity_api_key}
        publish_data = {
            "exchange": "amq.topic",
            "key": str(self.entity_id),
            "body": str(data)
        }
        with self.no_ssl_verification():
            r = requests.post(publish_url, json.dumps(publish_data), headers=publish_headers)
        response = dict()
        if "No API key" in str(r.content.decode("utf-8")):
            response["status"] = "failure"
            r = json.loads(r.content.decode("utf-8"))['message']
        elif 'publish message ok' in str(r.content.decode("utf-8")):
            response["status"] = "success"
            r = r.content.decode("utf-8")
        else:
            response["status"] = "failure"
            r = r.content.decode("utf-8")
        response["response"] = str(r)
        return response
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)
484721
def pub(self, topic, message):
        ''''''
        return self.post('pub', params={'topic': topic}, data=message)
96826
def put_content(self, content):
        
        if not isinstance(content, str):
            content = content.decode('utf-8')

        self.topic.publish(Message=content, **self.storage_args)
34875
def publish(self, subject, msg, reply=None):
        
        if msg is None:
            msg = ''

        if reply is None:
            command = 'PUB %s %d' % (subject, len(msg))
        else:
            command = 'PUB %s %s %d' % (subject, reply, len(msg))

        self._send(command)
        self._send(msg)
754821
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'])
        int_payload = {'payload': self.serial.dumps(payload)}

        # add some targeting stuff for lists only (for now)
        if load['tgt_type'] == 'list':
            int_payload['topic_lst'] = load['tgt']

        # If zmq_filtering is enabled, target matching has to happen master side
        match_targets = ["pcre", "glob", "list"]
        if self.opts['zmq_filtering'] and load['tgt_type'] in match_targets:
            # 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
        payload = self.serial.dumps(int_payload)
        log.debug(
            'Sending payload to publish daemon. jid=%s size=%d',
            load.get('jid', None), len(payload),
        )
        if not self.pub_sock:
            self.pub_connect()
        self.pub_sock.send(payload)
        log.debug('Sent payload to publish daemon.')
609093
function publish (channel, ...args) {
    _publishStream.emit('message', channel, uniqueId(`${node.name}_`), ...args)
  }
1118945
def post(payload = {})
      options={method: :post, 
        payload: payload, 
        headers:{content_type: :json, accept: :json}
      }
      run(options)
    end
1266989
def publish_event(self, channel, event, message):
        '''
        '''
        assert self.protocol is not None, "Protocol required"
        msg = {'event': event, 'channel': channel}
        if message:
            msg['data'] = message
        return self.publish(channel, msg)
1262131
def publish(self):
        " "

        # Publish changes.
        response = self.put('/REST/Zone/%s' % (
            self.zone, ), data={'publish': True})

        return response.content['data']['serial']
1282842
def publish_message(self, message, client):
        
        return client.execute_command('publish', {
            'topic': self.data['transport']['topic'],
            'body': {
                'messages': {
                    'data': self.pack(message)
                }
            }
        })
842726
def publish_post(self):
        
        payload = {'content': self.content_base64.decode('utf-8')}

        sha_blob = self.get_sha_blob()
        if sha_blob:
            commit_msg = 'ghPublish UPDATE: {}'.format(self.title)
            payload.update(sha=sha_blob)
            payload.update(message=commit_msg)
        else:
            commit_msg = 'ghPublish ADD: {}'.format(self.title)
            payload.update(message=commit_msg)

        r = requests.put(self.api_url,
                         auth=self.get_auth_details(),
                         data=json.dumps(payload))
        try:
            url = r.json()['content']['html_url']
            return r.status_code, url
        except KeyError:
            return r.status_code, None
777865
def publish (self):
        '''
         
        '''
        self.lock.acquire()
        tw = cmdvel2Twist(self.data)
        self.lock.release()
        self.pub.publish(tw)
139193
def publish(channel, value)
      redis = Attention.redis.call
      yield redis if block_given?
      redis.publish channel, payload_for(value)
    end
677765
function publish() {
  console.log('Client ' + clientId + ' is publishing to topic ' + topics.publish);
  // client.on('message',()=>{});
  // this is just for testing purpouse
  // maybe we dont need to stop and start publishing
  var timer = setInterval(function () {
    client.publish(topics.publish, 'ping');
    if (stopPub === true) {
      clearInterval(timer);
      stopPub = false;
    }
  }, 1000);
}
448448
public function publish($subject, $payload = null, $inbox = null)
    {
        $msg = 'PUB '.$subject;
        if ($inbox !== null) {
            $msg = $msg.' '.$inbox;
        }

        $msg = $msg.' '.strlen($payload);
        $this->send($msg."\r\n".$payload);
        $this->pubs += 1;
    }