def connection
      connection_acquired = false
      begin
        pool.with do |conn|
          connection_acquired = true
          yield(conn)
        end
      rescue Timeout::Error, ConnectionPool::PoolShuttingDownError => e
        if e.kind_of?(ConnectionPool::PoolShuttingDownError)
          @pool = nil
          Connection::Manager.delete_pool(self)
          raise Errors::PoolTimeout.new(e)
        end
        raise connection_acquired ? e : Errors::PoolTimeout.new(e)
      end
    end
def connection
      connection_acquired = false
      begin
        pool.with do |conn|
          connection_acquired = true
          yield(conn)
        end
      rescue Timeout::Error, ConnectionPool::PoolShuttingDownError => e
        if e.kind_of?(ConnectionPool::PoolShuttingDownError)
          @pool = nil
          Connection::Manager.delete_pool(self)
          raise Errors::PoolTimeout.new(e)
        end
        raise connection_acquired ? e : Errors::PoolTimeout.new(e)
      end
    end
Get the underlying connection for the node.

 @example Get the node's connection.
   node.connection

 @return [ Connection ] The connection.

 @since 2.0.0