lib/mongo/server/connection_pool.rb
# Stop the background populator thread and clean up any connections created
# which have not been connected yet.
#
# Used when closing the pool or when terminating the bg thread for testing
# purposes. In the latter case, this method must be called before the pool
# is used, to ensure no connections in pending_connections were created in-flow
# by the check_out method.
#
# @api private
Stop the background populator thread and clean up any connections created
which have not been connected yet.

Used when closing the pool or when terminating the bg thread for testing
purposes. In the latter case, this method must be called before the pool
is used, to ensure no connections in pending_connections were created in-flow
by the check_out method.
Stop the background populator thread and clean up any connections created which have not been connected yet . Used when closing the pool or when terminating the bg thread for testing purposes . In the latter case this method must be called before the pool is used to ensure no connections in pending_connections were created in - flow by the check_out method .
def stop_populator
        @populator.stop!
        @lock.synchronize do
          until @pending_connections.empty?
            connection = @pending_connections.take(1).first
            connection.disconnect!
            @pending_connections.delete(connection)
          end
        end
      end
def stop_populator @populator . stop! @lock . synchronize do until @pending_connections . empty? connection = @pending_connections . take ( 1 ) . first connection . disconnect! @pending_connections . delete ( connection ) end end end
Stop the background populator thread and clean up any connections created
which have not been connected yet.
Stop the background populator thread and clean up any connections created which have not been connected yet .
# If stop_populator is called while populate is running, there may be # connections waiting to be connected, connections which have not yet # been moved to available_connections, or connections moved to available_connections # but not deleted from pending_connections. These should be cleaned up.
api
None