RaspberryIO_26/Swan.Lite/Threading/IWorkerDelayProvider.cs
2019-12-08 19:54:52 +01:00

21 lines
844 B
C#

using System;
using System.Threading;
using System.Threading.Tasks;
namespace Swan.Threading {
/// <summary>
/// An interface for a worker cycle delay provider.
/// </summary>
public interface IWorkerDelayProvider {
/// <summary>
/// Suspends execution queues a new cycle for execution. The delay is given in
/// milliseconds. When overridden in a derived class the wait handle will be set
/// whenever an interrupt is received.
/// </summary>
/// <param name="wantedDelay">The remaining delay to wait for in the cycle.</param>
/// <param name="delayTask">Contains a reference to a task with the scheduled period delay.</param>
/// <param name="token">The cancellation token to cancel waiting.</param>
void ExecuteCycleDelay(Int32 wantedDelay, Task delayTask, CancellationToken token);
}
}