I have a number of stand alone web apps running on Windows severs that do various things in the background and the Web UI is used primarily to display a transaction log and an exceptions log. Depending on what the app needs to do I have used either a Thread that gets created at application launch and runs a continuous Do loop with a sleep period, or alternatively a Timer that launches a new thread at a specific interval, does the processing and then goes out of scope. In both cases the sleep period or timer is usually set to 10 seconds. The apps generally work great and do what they were created to do, however, every once in a while from weeks to months, one of these apps will quit processing even though the UI is responsive. The only solution to get it it going again is to stop and restart the service.
In these apps since the timers and threads run at the app level they are not web timers or web threads. I do use web timers and web threads where appropriate for Web Session UI functions but not for an app level function to process files and folders or Posts coming through HandleSpecialURL.
I would like to make these services more resilient and I'm looking for Ideas I might try, like auto-restart at intervals, or some way to monitor that a thread or timer has died and notify support. Someone may have solved a similar problem so I'm just fishing the pool of brilliant minds here.