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 46
46:     def self.extended(db)
47:       pool = db.pool
48:       if defined?(ShardedThreadedConnectionPool) && pool.is_a?(ShardedThreadedConnectionPool)
49:         pool.extend(ThreadedServerBlock)
50:         pool.instance_variable_set(:@default_servers, {})
51:       else
52:         pool.extend(UnthreadedServerBlock)
53:         pool.instance_variable_set(:@default_servers, [])
54:       end
55:     end

Public Instance methods

Delegate to the connection pool

[Source]

    # File lib/sequel/extensions/server_block.rb, line 58
58:     def with_server(server, &block)
59:       pool.with_server(server, &block)
60:     end

[Validate]