开发者

Custom TaskScheduler to start task by DateTime

开发者 https://www.devze.com 2023-02-12 15:35 出处:网络
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 开发者_如何转

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)?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消