This is the fastest connection pool, since it isn’t a connection pool at all. It is just a wrapper around a single connection that uses the connection pool API.
Disconnect the connection from the database.
# File lib/sequel/connection_pool/single.rb, line 12 def disconnect(opts=nil, &block) return unless @conn block ||= @disconnection_proc block.call(@conn) if block @conn = nil end
Yield the connection to the block.
# File lib/sequel/connection_pool/single.rb, line 20 def hold(server=nil) begin yield(@conn ||= make_new(DEFAULT_SERVER)) rescue Sequel::DatabaseDisconnectError disconnect raise end end
The SingleConnectionPool always has a size of 1 if connected and 0 if not.
# File lib/sequel/connection_pool/single.rb, line 7 def size @conn ? 1 : 0 end
Generated with the Darkfish Rdoc Generator 2.