Does timer in Web Service Global.asax block my Web Service from processing web-site requests?


Leo Violette

My Web Service has a Global.asax.cs file. In my Global class, I have a
Timer member called PollingTimer.

In Application_Start, I construct the polling timer and have it run every 30
seconds. The reason I do this is because
I want to report the status of some server machines on my web-site. But, if
I query the machine every time the web-site
requests it, it would make the request take too long. So, I have this
polling timer make the request every 30 seconds,
which I then store in the ApplicationState and when the Web-Site requests
the information from my service, I just
retrieve it from ApplicationState and return it back to the web-site.

Feel free to comment if you think that is a bad way to solve the problem.

But, my question is this:
When my timer fires and queries a remote server for status, is that blocking
my Web Service from receiving and
processing requests from the Web Site? If so, then does that mean that
instead of a timer, I should use a separate thread?

Thanks for your input.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question