lib/torquebox_tester.rb
# Start a time-consuming background task and wait for it to complete,
# reporting its progress.
Start a time-consuming background task and wait for it to complete,
reporting its progress.
Start a time - consuming background task and wait for it to complete reporting its progress .
def start_background_and_wait(times, pauses)
    logger.warn "#{@background_job_id} About to start twiddling #{times} times with #{pauses}-second waits and will not return until done"
    background_job_set_total_steps times
    tracker = background_correlate(background.twiddle_thumbs(@background_job_id, times, pauses))
    logger.warn "#{@background_job_id} wait tracker = #{tracker}, correlation_id = #{tracker.correlation_id}"
    loop do
      logger.warn "#{@background_job_id} started = #{tracker.started?}, error = #{tracker.error?}, complete = #{tracker.complete?}, status = #{tracker.status}"
      logger.warn "Report : #{background_job_report}"
      sleep(2)
      break if tracker.complete?
    end
    logger.warn "#{@background_job_id} started = #{tracker.started?}, error = #{tracker.error?}, complete = #{tracker.complete?}, status = #{tracker.status}"
    logger.warn "Report : #{background_job_report}"
    result = tracker.result
    logger.warn "#{@background_job_id} result = #{tracker.result}"
    result
  end
def start_background_and_wait ( times , pauses ) logger . warn "#{@background_job_id} About to start twiddling #{times} times with #{pauses}-second waits and will not return until done" background_job_set_total_steps times tracker = background_correlate ( background . twiddle_thumbs ( @background_job_id , times , pauses ) ) logger . warn "#{@background_job_id} wait tracker = #{tracker}, correlation_id = #{tracker.correlation_id}" loop do logger . warn "#{@background_job_id} started = #{tracker.started?}, error = #{tracker.error?}, complete = #{tracker.complete?}, status = #{tracker.status}" logger . warn "Report : #{background_job_report}" sleep ( 2 ) break if tracker . complete? end logger . warn "#{@background_job_id} started = #{tracker.started?}, error = #{tracker.error?}, complete = #{tracker.complete?}, status = #{tracker.status}" logger . warn "Report : #{background_job_report}" result = tracker . result logger . warn "#{@background_job_id} result = #{tracker.result}" result end
Start a time-consuming background task and wait for it to complete,
reporting its progress.
Start a time - consuming background task and wait for it to complete reporting its progress .
times
<not_specific>
pauses
<not_specific>