lib/mongo/cluster.rb
def remove(host, disconnect: true)
      address = Address.new(host)
      removed_servers = []
      @update_lock.synchronize do
        @servers.delete_if do |server|
          (server.address == address).tap do |delete|
            if delete
              removed_servers << server
            end
          end
        end
      end
      if disconnect != false
        removed_servers.each do |server|
          disconnect_server_if_connected(server)
        end
      end
      if disconnect != false
        removed_servers.any?
      else
        removed_servers
      end
    end
# Remove the server from the cluster for the provided address, if it
# exists.
#
# @example Remove the server from the cluster.
#   server.remove('127.0.0.1:27017')
#
# @param [ String ] host The host/port or socket address.
# @param [ true | false ] disconnect Whether to disconnect the servers
#   being removed. For internal driver use only.
#
# @return [ Array<Server> | true | false ] If disconnect is any value other
#   than false, including nil, returns whether any servers were removed.
#   If disconnect is false, returns an array of servers that were removed
#   (and should be disconnected by the caller).
#
# @note The return value of this method is not part of the driver's
#   public API.
#
# @since 2.0.0
Remove the server from the cluster for the provided address, if it
exists.
Remove the server from the cluster for the provided address if it exists .
def remove(host, disconnect: true)
      address = Address.new(host)
      removed_servers = []
      @update_lock.synchronize do
        @servers.delete_if do |server|
          (server.address == address).tap do |delete|
            if delete
              removed_servers << server
            end
          end
        end
      end
      if disconnect != false
        removed_servers.each do |server|
          disconnect_server_if_connected(server)
        end
      end
      if disconnect != false
        removed_servers.any?
      else
        removed_servers
      end
    end
def remove ( host , disconnect : true ) address = Address . new ( host ) removed_servers = [ ] @update_lock . synchronize do @servers . delete_if do | server | ( server . address == address ) . tap do | delete | if delete removed_servers << server end end end end if disconnect != false removed_servers . each do | server | disconnect_server_if_connected ( server ) end end if disconnect != false removed_servers . any? else removed_servers end end
Remove the server from the cluster for the provided address, if it
exists.
Remove the server from the cluster for the provided address if it exists .
If disconnect is any value other than false, including nil, returns whether any servers were removed. If disconnect is false, returns an array of servers that were removed (and should be disconnected by the caller).
If disconnect is any value other than false including nil returns whether any servers were removed . If disconnect is false returns an array of servers that were removed ( and should be disconnected by the caller ) .
 Array<Server> | true | false 
host
disconnect
disconnect Whether to disconnect the servers being removed. For internal driver use only.
disconnect Whether to disconnect the servers being removed . For internal driver use only .
example
Remove the server from the cluster.
Remove the server from the cluster .
note
The return value of this method is not part of the driver's public API.
The return value of this method is not part of the driver ' s public API .
since
None