def call_server(options)
        lb_all_bad_msg = 'all nodes failed to communicate with server!'
        response = nil

        # credentials if not defined explicitly
        options[:user] = user unless options.include? :user
        options[:password] = password unless options.include? :password
        debug_string = options[:uri]
        if debug_string
          query_log("Orientdb4r::Client#call_server", URI.decode(debug_string))
        end
        idx = lb_strategy.node_index
        raise OrientdbError, lb_all_bad_msg if idx.nil? # no good node found

        begin
          node = @nodes[idx]
          begin
            response = node.request options
            lb_strategy.good_one idx
            return response

          rescue NodeError => e
            Orientdb4r::logger.error "node error, index=#{idx}, msg=#{e.message}, #{node}"
            node.cleanup
            lb_strategy.bad_one idx
            idx = lb_strategy.node_index
          end
        end until idx.nil? and response.nil? # both 'nil' <= we tried all nodes and all with problem

        raise OrientdbError, lb_all_bad_msg
      end
def call_server(options)
        lb_all_bad_msg = 'all nodes failed to communicate with server!'
        response = nil

        # credentials if not defined explicitly
        options[:user] = user unless options.include? :user
        options[:password] = password unless options.include? :password
        debug_string = options[:uri]
        if debug_string
          query_log("Orientdb4r::Client#call_server", URI.decode(debug_string))
        end
        idx = lb_strategy.node_index
        raise OrientdbError, lb_all_bad_msg if idx.nil? # no good node found

        begin
          node = @nodes[idx]
          begin
            response = node.request options
            lb_strategy.good_one idx
            return response

          rescue NodeError => e
            Orientdb4r::logger.error "node error, index=#{idx}, msg=#{e.message}, #{node}"
            node.cleanup
            lb_strategy.bad_one idx
            idx = lb_strategy.node_index
          end
        end until idx.nil? and response.nil? # both 'nil' <= we tried all nodes and all with problem

        raise OrientdbError, lb_all_bad_msg
      end
Calls the server with a specific task.
 Returns a response according to communication channel (e.g. HTTP response).