|
-
Feb 7th, 2012, 06:28 AM
#14
Re: Best practice and/or ideas on how to do backend reporting
Yes, I would suggest a timer for a desktop app or service, as I think that quote concerns.
The reason I suggested a sleep call in this case is because the lifetime of a web request is a little different: the thread is spawned (or rather, activated) in response to an incoming HTTP request, and becomes dormant again once the response is served. In order to put off sending the response back to the client, we need to block the thread in between polling the database. A timer wouldn't be appropriate, because by nature they do not block execution and so the HTTP worker thread would expire.
I admit my knowledge of IIS/ASP.NET is lacking a little; my advice comes from an Apache/PHP perspective, but I believe the execution models to be very similar. Someone in the ASP.NET section (perhaps Gary or John) might be able to suggest a better solution than Thread.Sleep.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|