Class Index [+]

Quicksearch

Sequel::SingleConnectionPool

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.

Public Instance Methods

all_connections() click to toggle source

Yield the connection if one has been made.

    # File lib/sequel/connection_pool/single.rb, line 12
12:   def all_connections
13:     yield @conn if @conn
14:   end
disconnect(opts=nil, &block) click to toggle source

Disconnect the connection from the database.

    # File lib/sequel/connection_pool/single.rb, line 17
17:   def disconnect(opts=nil, &block)
18:     return unless @conn
19:     block ||= @disconnection_proc
20:     block.call(@conn) if block
21:     @conn = nil
22:   end
hold(server=nil) click to toggle source

Yield the connection to the block.

    # File lib/sequel/connection_pool/single.rb, line 25
25:   def hold(server=nil)
26:     begin
27:       yield(@conn ||= make_new(DEFAULT_SERVER))
28:     rescue Sequel::DatabaseDisconnectError
29:       disconnect
30:       raise
31:     end
32:   end
size() click to toggle source

The SingleConnectionPool always has a size of 1 if connected and 0 if not.

   # File lib/sequel/connection_pool/single.rb, line 7
7:   def size
8:     @conn ? 1 : 0
9:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.