method

try_to_checkout_new_connection

try_to_checkout_new_connection()
private

If the pool is not at a @max_connections limit, establish new connection. Connecting to the DB is done outside main synchronized section.

If a block is supplied, it is an additional constraint (checked while holding the pool lock) on whether a new connection should be established.