Proper way to implement a never ending task. (Timers vs Task)
I’d use TPL Dataflow for this (since you’re using .NET 4.5 and it uses Task internally). You can easily create an ActionBlock<TInput> which posts items to itself after it’s processed it’s action and waited an appropriate amount of time. First, create a factory that will create your never-ending task: ITargetBlock<DateTimeOffset> CreateNeverEndingTask( Action<DateTimeOffset> action, CancellationToken cancellationToken) … Read more