nats/aio/client.py
def _process_info(self, info):
        """
        Process INFO lines sent by the server to reconfigure client
        with latest updates from cluster to enable server discovery.
        """
        if 'connect_urls' in info:
            if info['connect_urls']:
                connect_urls = []
                for connect_url in info['connect_urls']:
                    uri = urlparse("nats://%s" % connect_url)
                    srv = Srv(uri)
                    srv.discovered = True

                    # Filter for any similar server in the server pool already.
                    should_add = True
                    for s in self._server_pool:
                        if uri.netloc == s.uri.netloc:
                            should_add = False
                    if should_add:
                        connect_urls.append(srv)

                if self.options["dont_randomize"] is not True:
                    shuffle(connect_urls)
                for srv in connect_urls:
                    self._server_pool.append(srv)
def _process_info(self, info):
        """
        Process INFO lines sent by the server to reconfigure client
        with latest updates from cluster to enable server discovery.
        """
        if 'connect_urls' in info:
            if info['connect_urls']:
                connect_urls = []
                for connect_url in info['connect_urls']:
                    uri = urlparse("nats://%s" % connect_url)
                    srv = Srv(uri)
                    srv.discovered = True

                    # Filter for any similar server in the server pool already.
                    should_add = True
                    for s in self._server_pool:
                        if uri.netloc == s.uri.netloc:
                            should_add = False
                    if should_add:
                        connect_urls.append(srv)

                if self.options["dont_randomize"] is not True:
                    shuffle(connect_urls)
                for srv in connect_urls:
                    self._server_pool.append(srv)
def _process_info ( self , info ) : if 'connect_urls' in info : if info [ 'connect_urls' ] : connect_urls = [ ] for connect_url in info [ 'connect_urls' ] : uri = urlparse ( "nats://%s" % connect_url ) srv = Srv ( uri ) srv . discovered = True # Filter for any similar server in the server pool already. should_add = True for s in self . _server_pool : if uri . netloc == s . uri . netloc : should_add = False if should_add : connect_urls . append ( srv ) if self . options [ "dont_randomize" ] is not True : shuffle ( connect_urls ) for srv in connect_urls : self . _server_pool . append ( srv )
Process INFO lines sent by the server to reconfigure client
        with latest updates from cluster to enable server discovery.
Process INFO lines sent by the server to reconfigure client with latest updates from cluster to enable server discovery .