def disconnect!(wait=false)
      unless @connecting || @connected
        return true
      end
      @periodic_executor.stop!
      @servers.each do |server|
        if server.connected?
          server.disconnect!(wait)
          publish_sdam_event(
            Monitoring::SERVER_CLOSED,
            Monitoring::Event::ServerClosed.new(server.address, topology)
          )
        end
      end
      publish_sdam_event(
        Monitoring::TOPOLOGY_CLOSED,
        Monitoring::Event::TopologyClosed.new(topology)
      )
      @connecting = @connected = false
      true
    end
def disconnect!(wait=false)
      unless @connecting || @connected
        return true
      end
      @periodic_executor.stop!
      @servers.each do |server|
        if server.connected?
          server.disconnect!(wait)
          publish_sdam_event(
            Monitoring::SERVER_CLOSED,
            Monitoring::Event::ServerClosed.new(server.address, topology)
          )
        end
      end
      publish_sdam_event(
        Monitoring::TOPOLOGY_CLOSED,
        Monitoring::Event::TopologyClosed.new(topology)
      )
      @connecting = @connected = false
      true
    end
Disconnect all servers.

 @note Applications should call Client#close to disconnect from
 the cluster rather than calling this method. This method is for
 internal driver use only.

 @example Disconnect the cluster's servers.
   cluster.disconnect!

 @param [ Boolean ] wait Whether to wait for background threads to
   finish running.

 @return [ true ] Always true.

 @since 2.1.0