0

Possible Duplicate:
How do I schedule a task to run at periodic intervals?

What I need to do is have a recurring task that updates a list every few configurable number of minutes. I want to wait for the task to finish and after it is finished it will return to the caller class and continue running the program. Also the caller class has an infinite loop because the application is intended to never stop. I had no luck with Timer class and I tried Quartz but that was worse than the Timer to implement successfully.

Has anyone had the same problem as I have and succeeded in creating a scheduler that handles recurring tasks and the caller class waits for it to finish the task when the time starts?

Community
  • 1
  • 1
ColinMc
  • 1,168
  • 2
  • 15
  • 32
  • @VivinPaliath I tried that it did not work for me. The only issue I am really having is making the caller class always wait for the task to finish before it continues executing the class. – ColinMc Nov 13 '12 at 20:06
  • how about the calling the join() method, it will make the calling thread wait until the Thread you want to run every x minutes to complete – bvanvelsen Nov 13 '12 at 20:32
  • @bvanvelsen I tried that and it did not work for my use case. After doing some more analysis on it, I realized that there are some cons for having a scheduler and infinite loops. I wrote it down for a person at work to make the decision of what to do with it. Thanks for the suggestion. :) – ColinMc Nov 14 '12 at 13:17

0 Answers0