Module Sequel::ServerBlock
In: lib/sequel/extensions/server_block.rb

Methods

Public Class methods

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.

[Source]

    # File lib/sequel/extensions/server_block.rb, line 37
37:     def self.extended(db)
38:       pool = db.pool
39:       if defined?(ShardedThreadedConnectionPool) && pool.is_a?(ShardedThreadedConnectionPool)
40:         pool.extend(ThreadedServerBlock)
41:         pool.instance_variable_set(:@default_servers, {})
42:       else
43:         pool.extend(UnthreadedServerBlock)
44:         pool.instance_variable_set(:@default_servers, [])
45:       end
46:     end

Public Instance methods

Delegate to the connection pool

[Source]

    # File lib/sequel/extensions/server_block.rb, line 49
49:     def with_server(server, &block)
50:       pool.with_server(server, &block)
51:     end

[Validate]