Consider this code...
using System.Threading;
//...
Timer someWork = new Timer(
delegate(object state) {
//Do some work here...
},
null, 0, 60000);
HttpContext.Current.Application["SomeWorkItem"] = someWork;
Could this be dangerous? Caching a timer in the Application to perform some work in the background while your site runs seems safe, but I wondered if anyone has some experience with this.
I'm sure that writing a Service to run in the background would certainly be much better, but sometimes that isn't always an option. Is this an alternative?