public function connectToNSQLookupd($addr)
    {
        if ($this->isStopped) {
            throw new NsqException("consumer stopped");
        }

        $addr = $this->formatAddress($addr);
        if (isset($this->lookupdHTTPAddrs[$addr])) {
            return;
        }

        $this->lookupdHTTPAddrs[$addr] = [];
        yield $this->queryLookupd($addr);

        if (count($this->lookupdHTTPAddrs) === 1) {
            // reconnecting will be triggered on connection close,
            // so no need to check number of connections in tick timer
            $this->lookupdPollingTick();
        }
    }
public function connectToNSQLookupd($addr)
    {
        if ($this->isStopped) {
            throw new NsqException("consumer stopped");
        }

        $addr = $this->formatAddress($addr);
        if (isset($this->lookupdHTTPAddrs[$addr])) {
            return;
        }

        $this->lookupdHTTPAddrs[$addr] = [];
        yield $this->queryLookupd($addr);

        if (count($this->lookupdHTTPAddrs) === 1) {
            // reconnecting will be triggered on connection close,
            // so no need to check number of connections in tick timer
            $this->lookupdPollingTick();
        }
    }
public function connectToNSQLookupd ( $ addr ) { if ( $ this -> isStopped ) { throw new NsqException ( "consumer stopped" ) ; } $ addr = $ this -> formatAddress ( $ addr ) ; if ( isset ( $ this -> lookupdHTTPAddrs [ $ addr ] ) ) { return ; } $ this -> lookupdHTTPAddrs [ $ addr ] = [ ] ; yield $ this -> queryLookupd ( $ addr ) ; if ( count ( $ this -> lookupdHTTPAddrs ) === 1 ) { // reconnecting will be triggered on connection close, // so no need to check number of connections in tick timer $ this -> lookupdPollingTick ( ) ; } }
ConnectToNSQLookupd adds an nsqlookupd address to the list for this Consumer instance.
If it is the first to be added, it initiates an Tick Timer to discover nsqd
producers for the configured topic.

@param string $addr
@return \Generator|void Connection[]
@throws NsqException
ConnectToNSQLookupd adds an nsqlookupd address to the list for this Consumer instance . If it is the first to be added it initiates an Tick Timer to discover nsqd producers for the configured topic .