.Net long-running scheduled code execution
- by Prof Plum
I am working on a couple of projects now where I really wish there was some sort of component that I could specify a time and date, and then execute some sort of method.
DateTime date = new DateTime(x,x,x,x,x,x);
ScheduledMethod sMethod = new ScheduledMethod(date, [method delegate of some sort]);
\\at the specified date, sMethod invokes [method delegate of some sort]
I know that I can do this with Windows Workflow Foundation as a long running process, which is good for certain things, but are there any alternatives? Workflow is not exactly straight forward with the details, and it would be nice to be able to deploy something more simple for light weight tasks. An example would be a method that checks a network folder once a day and deletes any files that are more than 30 days old. I realize that this may be pie in the sky dreaming, but this would be extremely useful for automating certain mundane maintinence tasks (scheduled sql operations, file system cleansing, routine email sending, etc.). It does not necessarily have to be .Net, but that is where I am coming from. Any ideas?