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 38
38:     def self.extended(db)
39:       pool = db.pool
40:       if defined?(ShardedThreadedConnectionPool) && pool.is_a?(ShardedThreadedConnectionPool)
41:         pool.extend(ThreadedServerBlock)
42:         pool.instance_variable_set(:@default_servers, {})
43:       else
44:         pool.extend(UnthreadedServerBlock)
45:         pool.instance_variable_set(:@default_servers, [])
46:       end
47:     end

Public Instance methods

Delegate to the connection pool

[Source]

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

[Validate]