Method: SingleThreadedPool#hold

Defined in:
lib/assistance/connection_pool.rb

#holdObject

Yields the connection to the supplied block. This method simulates the ConnectionPool#hold API.



136
137
138
139
140
141
142
# 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