Method: Sequel::ThreadedConnectionPool#all_connections

Defined in:
lib/sequel/connection_pool/threaded.rb

#all_connectionsObject

Yield all of the available connections, and the one currently allocated to this thread. This will not yield connections currently allocated to other threads, as it is not safe to operate on them. This holds the mutex while it is yielding all of the available connections, which means that until the method’s block returns, the pool is locked.



44
45
46
47
48
49
50
51
# File 'lib/sequel/connection_pool/threaded.rb', line 44

def all_connections
  hold do |c|
    sync do
      yield c
      @available_connections.each{|conn| yield conn}
    end
  end
end