SystemTarget.RegisterTimer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Registers a timer to send regular callbacks to this grain. This timer will keep the current grain from being deactivated.
public IDisposable RegisterTimer (Func<object,System.Threading.Tasks.Task> asyncCallback, object state, TimeSpan dueTime, TimeSpan period, string name = default);
member this.RegisterTimer : Func<obj, System.Threading.Tasks.Task> * obj * TimeSpan * TimeSpan * string -> IDisposable
Public Function RegisterTimer (asyncCallback As Func(Of Object, Task), state As Object, dueTime As TimeSpan, period As TimeSpan, Optional name As String = Nothing) As IDisposable
Parameters
- state
- Object
The state object passed to the callback.
- dueTime
- TimeSpan
The amount of time to delay before the asyncCallback
is invoked.
Specify InfiniteTimeSpan to prevent the timer from starting.
Specify Zero to invoke the callback promptly.
- period
- TimeSpan
The time interval between invocations of asyncCallback
.
Specify InfiniteTimeSpan to disable periodic signalling.
- name
- String
The timer name.
Returns
An IDisposable object which will cancel the timer upon disposal.