Method: Sequel::ConnectionPool#initialize
- Defined in:
- lib/sequel/connection_pool.rb
#initialize(db, opts = OPTS) ⇒ ConnectionPool
Instantiates a connection pool with the given options. The block is called with a single symbol (specifying the server/shard to use) every time a new connection is needed. The following options are respected for all connection pools:
- :after_connect
-
The proc called after each new connection is made, with the connection object, useful for customizations that you want to apply to all connections.
75 76 77 78 |
# File 'lib/sequel/connection_pool.rb', line 75 def initialize(db, opts=OPTS) @db = db @after_connect = opts[:after_connect] end |