I got:
internal void Start(CancellationToken token)
{
while (!token.IsCancellationRequested)
{
//do work
token.WaitHandle.WaitOne(TimeSpan.FromSeconds(67));
}
}
So i start this method in new Task
and do some work in loop untill i need to cancel it with token
Some times i need to force new loop iteration, without waiting this 67 seconds.
I think i need something like:
public ManualResetEvent ForceLoopIteration { get; set; }
Meanwhile i cant understand how to use it with token.
Maybe something like WaitHandle.WaitAny()
?