def disconnect!(wait=false)
      begin
        # For backwards compatibility we disconnect/clear the pool rather
        # than close it here.
        pool.disconnect!
      rescue Error::PoolClosedError
        # If the pool was already closed, we don't need to do anything here.
      end
      monitor.stop!(wait)
      @connected = false
      true
    end
def disconnect!(wait=false)
      begin
        # For backwards compatibility we disconnect/clear the pool rather
        # than close it here.
        pool.disconnect!
      rescue Error::PoolClosedError
        # If the pool was already closed, we don't need to do anything here.
      end
      monitor.stop!(wait)
      @connected = false
      true
    end
Disconnect the server from the connection.

 @example Disconnect the server.
   server.disconnect!

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

 @return [ true ] Always true with no exception.

 @since 2.0.0