(self)
Sync our Servers from TopologyDescription.server_descriptions.

        Hold the lock while calling this.
Sync our Servers from TopologyDescription.server_descriptions.
Sync our Servers from TopologyDescription . server_descriptions .
def _update_servers(self):
        """Sync our Servers from TopologyDescription.server_descriptions.

        Hold the lock while calling this.
        """
        for address, sd in self._description.server_descriptions().items():
            if address not in self._servers:
                monitor = self._settings.monitor_class(
                    server_description=sd,
                    topology=self,
                    pool=self._create_pool_for_monitor(address),
                    topology_settings=self._settings)

                weak = None
                if self._publish_server:
                    weak = weakref.ref(self._events)
                server = Server(
                    server_description=sd,
                    pool=self._create_pool_for_server(address),
                    monitor=monitor,
                    topology_id=self._topology_id,
                    listeners=self._listeners,
                    events=weak)

                self._servers[address] = server
                server.open()
            else:
                self._servers[address].description = sd

        for address, server in list(self._servers.items()):
            if not self._description.has_server(address):
                server.close()
                self._servers.pop(address)
def _update_servers ( self ) : for address , sd in self . _description . server_descriptions ( ) . items ( ) : if address not in self . _servers : monitor = self . _settings . monitor_class ( server_description = sd , topology = self , pool = self . _create_pool_for_monitor ( address ) , topology_settings = self . _settings ) weak = None if self . _publish_server : weak = weakref . ref ( self . _events ) server = Server ( server_description = sd , pool = self . _create_pool_for_server ( address ) , monitor = monitor , topology_id = self . _topology_id , listeners = self . _listeners , events = weak ) self . _servers [ address ] = server server . open ( ) else : self . _servers [ address ] . description = sd for address , server in list ( self . _servers . items ( ) ) : if not self . _description . has_server ( address ) : server . close ( ) self . _servers . pop ( address )