Method: Mongo::Server::ConnectionPool#initialize

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

#initialize(options = {}, &block) ⇒ ConnectionPool

Note:

A block must be passed to set up the connections on initialization.

Create the new connection pool.

Examples:

Create the new connection pool.

Pool.new(timeout: 0.5) do
  Connection.new
end

Parameters:

  • options (Hash) (defaults to: {})

    The connection pool options.

Since:

  • 2.0.0



78
79
80
81
# File 'lib/mongo/server/connection_pool.rb', line 78

def initialize(options = {}, &block)
  @options = options.freeze
  @queue = Queue.new(options, &block)
end