0

I am writing a C++ application that, among other duties, periodically (once in hour) makes requests to server.
This scheduled task can be interrupted and forced to execute earlier (when application receives new user data). I've decided to use ConcRT for this purpose.

  • Is there any standard way of such scheduling (like Timer Queues in Win32) but with tasks and task groups?
  • Or I just should chain tasks with continuations?
  • Maybe Agents Library is more suitable for this? (I thought of it as overkill for my problem)

P.S. HTTP requests are made with good-old WinHTTP (executable must not rely on third-party libraries and keep it's size small). So is there any asynchronous implementations of HTTP request functionality, compliant with ConcRT mechanisms?

Andrew S
  • 23
  • 5

1 Answers1

0

You can use the concurrency::timer class in for this

Rick
  • 3,145
  • 15
  • 17
  • You mean just putting the request in timer callback? Or something more sophisticated, like spawning an agent that will receive timer messages? – Andrew S Apr 21 '13 at 15:42
  • you can use the timer class to do this. It will run a periodic task, that's what it is for, there is an example here: http://msdn.microsoft.com/en-us/library/dd504833.aspx#timer it doesn't need to be an agent if you don't want it to be. – Rick Apr 21 '13 at 16:15
  • Thank you. The reason I was asking is because using just timer does not give me control over cancellation of this task or changing it schedule, depending on it's result. – Andrew S Apr 21 '13 at 16:37