module Sequel::ConnectionPool::ClassMethods

  1. lib/sequel/connection_pool.rb
Parent: ConnectionPool

Class methods used to return an appropriate pool subclass, separated into a module for easier overridding by extensions.

Methods

Public Instance

  1. get_pool

Public Instance methods

get_pool (opts = {}, &block)

Return a pool subclass instance based on the given options. If a :pool_class option is provided is provided, use that pool class, otherwise use a new instance of an appropriate pool subclass based on the :single_threaded and :servers options.

[show source]
# File lib/sequel/connection_pool.rb, line 42
def get_pool(opts = {}, &block)
  case v = connection_pool_class(opts)
  when Class
    v.new(opts, &block)
  when Symbol
    Sequel.ts_require("connection_pool/#{v}")
    connection_pool_class(opts).new(opts, &block) || raise(Sequel::Error, "No connection pool class found")
  end
end