Connects to publisher
499203
def connect(self):
        
        self.client = redis.Redis(
            host=self.host, port=self.port, password=self.password)
962175
function (fn) {
    if (fn.length === 1) {
      fn = _.wrap(fn, function(func, evt, callback) {
        func(evt);
        callback(null);
      });
    }

    this.publisher = fn;

    return this;
  }
988824
def register_publisher(topic, topic_type)
      code, message, uris = @proxy.registerPublisher(@caller_id,
                                                     topic,
                                                     topic_type,
                                                     @slave_uri)
      if code == 1
        uris
      else
        raise message
      end
    end
729624
private void sendPublishStartNotify() {
        Status publishStatus = new Status(StatusCodes.NS_PUBLISH_START);
        publishStatus.setClientid(getStreamId());
        publishStatus.setDetails(getPublishedName());

        StatusMessage startMsg = new StatusMessage();
        startMsg.setBody(publishStatus);
        pushMessage(startMsg);
        setState(StreamState.PUBLISHING);
    }
734202
def connect(self, cback, subscribers=None, instance=None):
        
        if subscribers is None:
            subscribers = self.subscribers
        # wrapper
        if self._fconnect is not None:
            def _connect(cback):
                self._connect(subscribers, cback)

            notify = partial(self._notify_one, instance)
            if instance is not None:
                result = self._fconnect(instance, cback, subscribers,
                                        _connect, notify)
            else:
                result = self._fconnect(cback, subscribers, _connect, notify)
            if inspect.isawaitable(result):
                result = pull_result(result)
        else:
            self._connect(subscribers, cback)
            result = None
        return result
49192
async def connect(self):
        
        self.tls_context = None

        if self.tls:
            self.tls_context = self.create_tls_context()

        (self.reader, self.writer) = await asyncio.open_connection(
            host=self.hostname,
            port=self.port,
            local_addr=self.source_address,
            ssl=self.tls_context,
            loop=self.eventloop
        )
949189
def _publish(self, msg):
        
        connection = self._connection.clone()
        publish = connection.ensure(self.producer, self.producer.publish,
                                    errback=self.__error_callback,
                                    max_retries=MQ_PRODUCER_MAX_RETRIES)
        publish(json.dumps(msg), exchange=self._exchange,
                routing_key=self._routing_key, declare=[self._queue])
        logging.debug('Publisher: message sent: %s', msg)
997150
public <T> void publisher(Class<T> api,
                          Result<T> result)
  {
    String path = api.getName();
      
    String address = address(path);
      
    ServicesAmp manager = ServicesAmp.current();
    ServiceRefAmp pubRef = manager.service(address);
      
    result.ok(pubRef.as(api));
  }
884365
def start(self):
        '''
        
        '''
        # metrics
        napalm_logs_publisher_received_messages = Counter(
            'napalm_logs_publisher_received_messages',
            "Count of messages received by the publisher",
            ['publisher_type', 'address', 'port']
        )
        napalm_logs_publisher_whitelist_blacklist_check_fail = Counter(
            'napalm_logs_publisher_whitelist_blacklist_check_fail',
            "Count of messages which fail the whitelist/blacklist check",
            ['publisher_type', 'address', 'port']
        )
        napalm_logs_publisher_messages_published = Counter(
            'napalm_logs_publisher_messages_published',
            "Count of published messages",
            ['publisher_type', 'address', 'port']
        )
        self._setup_ipc()
        # Start suicide polling thread
        thread = threading.Thread(target=self._suicide_when_without_parent, args=(os.getppid(),))
        thread.start()
        signal.signal(signal.SIGTERM, self._exit_gracefully)
        self.transport.start()
        self.__up = True
        while self.__up:
            try:
                bin_obj = self.sub.recv()
            except zmq.ZMQError as error:
                if self.__up is False:
                    log.info('Exiting on process shutdown')
                    return
                else:
                    log.error(error, exc_info=True)
                    raise NapalmLogsExit(error)
            obj = umsgpack.unpackb(bin_obj)
            if self._strip_message_details:
                obj.pop('message_details', None)
                bin_obj = self.serializer_fun(obj)
            napalm_logs_publisher_received_messages.labels(
                publisher_type=self._transport_type,
                address=self.address,
                port=self.port
            ).inc()
            if not napalm_logs.ext.check_whitelist_blacklist(obj['error'],
                                                             whitelist=self.error_whitelist,
                                                             blacklist=self.error_blacklist):
                # Apply the whitelist / blacklist logic
                # If it doesn't match, jump over.
                log.debug('This error type is %s. Skipping for %s #%d',
                          obj['error'],
                          self._transport_type,
                          self.pub_id)
                napalm_logs_publisher_whitelist_blacklist_check_fail.labels(
                    publisher_type=self._transport_type,
                    address=self.address,
                    port=self.port
                ).inc()
                continue
            serialized_obj = self._serialize(obj, bin_obj)
            log.debug('Publishing the OC object')
            if not self.disable_security and self.__transport_encrypt:
                # Encrypt only when needed.
                serialized_obj = self._prepare(serialized_obj)
            self.transport.publish(serialized_obj)
            napalm_logs_publisher_messages_published.labels(
                publisher_type=self._transport_type,
                address=self.address,
                port=self.port
            ).inc()
984246
protected function registerPublisher(): void
    {
        $this->app->singleton('orchestra.publisher', function (Application $app) {
            $memory = $app->make('orchestra.platform.memory');

            return (new PublisherManager($app))->attach($memory);
        });
    }
611656
def publish
      publisher.publish('instance', added: info) do |redis|
        redis.setex "instance_#{ @id }", Attention.options[:ttl], JSON.dump(info)
      end
      heartbeat
    end
508726
def connect(self):
        
        print('Connecting to %s' % self._link_uri)
        self._cf.open_link(self._link_uri)
1334153
def publish(self, message, key=None, **kws):
        """"""
        return PSPut(self, message, key, **kws)
859014
protected function triggerPublish()
    {
        $this->info('Starting publishing vendor assets.');
        $this->call('vendor:publish');
        $this->info('Publishing vendor assets finished.');

        // Reload config
        $this->laravel['Illuminate\Foundation\Bootstrap\LoadConfiguration']->bootstrap($this->laravel);
    }
519544
def _connect(cls):
        
        post_save.connect(
            notify_items, sender=cls,
            dispatch_uid='knocker_{0}'.format(cls.__name__)
        )
815771
def publish (self):
        '''
         
        '''
        self.lock.acquire()
        tw = cmdvel2Twist(self.vel)
        self.lock.release()
        if (self.jdrc.getState() == "flying"):
            self.pub.publish(tw)
618981
def publish(self, topic, message):
        
        if not self.connections:
            raise NSQNoConnections()
        conn = random.choice(list(self.connections))
        conn.publish(topic, message)