Module | Sequel::ServerBlock |
In: |
lib/sequel/extensions/server_block.rb
|
Enable the server block on the connection pool, choosing the correct extension depending on whether the connection pool is threaded or not. Also defines the with_server method on the receiver for easy use.
# File lib/sequel/extensions/server_block.rb, line 64 64: def self.extended(db) 65: pool = db.pool 66: if defined?(ShardedThreadedConnectionPool) && pool.is_a?(ShardedThreadedConnectionPool) 67: pool.extend(ThreadedServerBlock) 68: pool.instance_variable_set(:@default_servers, {}) 69: else 70: pool.extend(UnthreadedServerBlock) 71: pool.instance_variable_set(:@default_servers, []) 72: end 73: end