Class IntervalActionWorker
Executes an action with specific interval (it will adjust delay between executions based on the action execution time).
Inheritance
System.Object
IntervalActionWorker
Implements
Inherited Members
Namespace: Eco.Core.Utils.Threading
Assembly: Eco.Core.dll
Syntax
public class IntervalActionWorker : RepeatableActionWorker, IWorker
Constructors
IntervalActionWorker(TimeSpan, Func<CancellationToken, Task>)
Declaration
public IntervalActionWorker(TimeSpan interval, Func<CancellationToken, Task> repeatableAction)
Parameters
| Type | Name | Description |
|---|---|---|
| System.TimeSpan | interval | |
| System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task> | repeatableAction |
Properties
Interval
Interval between RepeatableAction executions.
Declaration
public TimeSpan Interval { get; set; }
Property Value
| Type | Description |
|---|---|
| System.TimeSpan |
Methods
DoRepeatableWork(CancellationToken)
Performs repeatable work, may be cancelled with token.
Declaration
protected override Task DoRepeatableWork(CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | token |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |