Method: Moneta::Pool#initialize

Defined in:
lib/moneta/pool.rb

#initialize(options = {}) { ... } ⇒ Pool

Returns a new instance of Pool.

Parameters:

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

Options Hash (options):

  • :min (Integer) — default: 0

    The minimum pool size

  • :max (Integer)

    The maximum pool size. If not specified, there is no maximum.

  • :ttl (Numeric)

    The number of seconds to keep stores above the minumum number around for without activity. If not specified, stores will never be removed.

  • :timeout (Numeric)

    The number of seconds to wait for a store to become available. If not specified, will wait forever.

Yields:

  • A builder context for speciying how to construct stores



309
310
311
312
313
# File 'lib/moneta/pool.rb', line 309

def initialize(options = {}, &block)
  @id = "Moneta::Pool(#{object_id})"
  @manager = PoolManager.new(Builder.new(&block), **options)
  super(nil, options)
end