A SingleThreadedPool acts as a replacement for a ConnectionPool for use in single-threaded applications. ConnectionPool imposes a substantial performance penalty, so SingleThreadedPool is used to gain some speed.
Disconnects from the database. Once a connection is requested using hold, the connection is reestablished.
# File lib/assistance/connection_pool.rb, line 146 def disconnect(&block) block[@conn] if block && @conn @conn = nil end
Yields the connection to the supplied block. This method simulates the ConnectionPool#hold API.
# File lib/assistance/connection_pool.rb, line 136 def hold @conn ||= @connection_proc.call yield @conn rescue Exception => e # if the error is not a StandardError it is converted into RuntimeError. raise e.is_a?(StandardError) ? e : e.message end
Generated with the Darkfish Rdoc Generator 2.