Interface IScheduler
Inherited Members
System.IDisposable.Dispose()
Namespace:App.Metrics.Scheduling.Abstractions
Assembly:cs.temp.dll.dll
Syntax
public interface IScheduler : IDisposable
Methods
Interval(TimeSpan, TaskCreationOptions, Action)
Schedules at Task to run at the specified interval. All Tasks created with this instance share the same cancellation token
Declaration
Task Interval(TimeSpan pollInterval, TaskCreationOptions taskCreationOptions, Action action)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | pollInterval | The poll interval. |
TaskCreationOptions | taskCreationOptions | The task creation options. |
System.Action | action | The action to run at the specified interval. |
Returns
Type | Description |
---|---|
Task | A Task which executes the specified action at the give poll interval |
Interval(TimeSpan, TaskCreationOptions, Action, CancellationToken)
Schedules at Task to run at the specified interval.
Declaration
Task Interval(TimeSpan pollInterval, TaskCreationOptions taskCreationOptions, Action action, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | pollInterval | The poll interval. |
TaskCreationOptions | taskCreationOptions | The task creation options. |
System.Action | action | The action to run at the specified interval. |
CancellationToken | token | The Tasks cancellation token, each Tasks tokens are linked to this instance |
Returns
Type | Description |
---|---|
Task | A Task which executes the specified action at the give poll interval |
Stop()
Stops the Tasks schduled with this instance by cancelling the cancellation token
Declaration
void Stop()