I need to call function on timer (lets say onTickTack() function) and reload some info in ASP.NET MVC project. I know that there are several ways to do that, but which one is the best by your opinion?
Note: the function should be called from one place only, and should be called every X mins till application is up.
EDIT 1:
Reload some info – for example I have something in the Cache and I want to update it from DB on timer – once a day in certain time.
The answer to this question would very much depend on what do you mean by reload some info in ASP.NET MVC project. This is not a clearly stated problem and as such, more than obviously, it cannot have a clearly stated answer.
So if we assume that by this you want to periodically poll some controller action and update information on a view you could use the setInterval javascript function to periodically poll the server by sending an AJAX request and update the UI:
If on the other hand you mean executing some task on the server at regular periods you could use the RegisterWaitForSingleObject method like this:
If you mean something else, don’t hesitate to provide more details to your question.