def send_async_request(params)
      data = send_request(params)

      params = {
        'command' => 'queryAsyncJobResult',
        'jobid' => data['jobid']
      }

      max_tries.times do
        data = send_request(params)
        print "." if @verbose

        case data['jobstatus']
        when 1
          return data['jobresult']
        when 2
          raise JobError, "Request failed (#{data['jobresultcode']}): #{data['jobresult']['errortext']}."
        end

        STDOUT.flush if @verbose
        sleep @async_poll_interval
      end

      raise TimeoutError, "Asynchronous request timed out."
    end
def send_async_request(params)
      data = send_request(params)

      params = {
        'command' => 'queryAsyncJobResult',
        'jobid' => data['jobid']
      }

      max_tries.times do
        data = send_request(params)
        print "." if @verbose

        case data['jobstatus']
        when 1
          return data['jobresult']
        when 2
          raise JobError, "Request failed (#{data['jobresultcode']}): #{data['jobresult']['errortext']}."
        end

        STDOUT.flush if @verbose
        sleep @async_poll_interval
      end

      raise TimeoutError, "Asynchronous request timed out."
    end
Sends an asynchronous request and waits for the response.

 The contents of the 'jobresult' element are returned upon completion of the command.