Method: Mongo::Server::ConnectionPool#disconnect!

Defined in:
lib/mongo/server/connection_pool.rb

#disconnect!(options = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Disconnects the pool.

Does everything that clear does, except if the pool is closed this method does nothing but clear would raise PoolClosedError.

Since:

  • 2.1.0



537
538
539
540
541
542
543
# File 'lib/mongo/server/connection_pool.rb', line 537

def disconnect!(options = nil)
  do_clear(options)
rescue Error::PoolClosedError
  # The "disconnected" state is between closed and paused.
  # When we are trying to disconnect the pool, permit the pool to be
  # already closed.
end