Class StdBSPeriodicTasks
Standard class to deal with periodic async tasks.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: StdPlatBS100.ServiceClasses
Assembly: StdPlatBS100.dll
Syntax
public class StdBSPeriodicTasks : StdBSBaseService
Constructors
StdBSPeriodicTasks()
Declaration
public StdBSPeriodicTasks()
Methods
Start(Action, Int32, Int32, Int32, Int32, Boolean, CancellationToken, TaskCreationOptions)
Starts the periodic task.
Declaration
public static Task Start(Action action, int interval = -1, int delay = 0, int duration = -1, int maxIterations = -1, bool synchronous = false, CancellationToken cancelToken = default(CancellationToken), TaskCreationOptions creationOptions = TaskCreationOptions.None)
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action. |
System.Int32 | interval | The interval in milliseconds. |
System.Int32 | delay | The delay in milliseconds, i.e. how long it waits to kick off the timer. |
System.Int32 | duration | The duration is the maximum time this task is allowed to run is 10 seconds. |
System.Int32 | maxIterations | The max iterations. |
System.Boolean | synchronous | if set to |
System.Threading.CancellationToken | cancelToken | The cancel token. |
System.Threading.Tasks.TaskCreationOptions | creationOptions | System.Threading.Tasks.TaskCreationOptions used to create the task for executing the System.Action. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Remarks
Exceptions that occur in the action
need to be handled in the action itself. These exceptions will not be bubbled up to the periodic task.