Reputation: 35544
I´m currently investigating the namespace System.Threading.Tasks and the abstract base class TaskScheduler. I also found the ParallelExtensionsExtra with some custom schedulers inherited from TaskScheduler.
But i need a TaskScheduler that allows me to specify a DateTime, when to execute a task. Can anybody provide such a class or found it anywhere on the internet and share a link.
If not how could i implement such a TaskScheduler on my own (with TaskScheduler as base class)?
Upvotes: 2
Views: 4711
Reputation: 49195
System.Threading.Task.TaskScheduler
is part of parallel library introduced with .NET 4 - its about executing tasks concurrently (parallel). The scheduling is related to scheduling work on threads/cores rather than over some time horizon/period. Are you sure this is what you are looking for?
Windows have scheduled tasks that allows you to schedule some work on specific date/time and/or with specific periodicity/frequency. See this article that provides wrapper in .NET to use this functionality. Perhaps this will fit your requirement.
Upvotes: 4