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.
Overloads
RegisterTimer(Func<Object,Task>, Object, TimeSpan, TimeSpan, String) |
Registers a timer to send regular callbacks to this grain. This timer will keep the current grain from being deactivated. |
RegisterTimer(Func<Object,Task>, Object, TimeSpan, TimeSpan) |
Registers a timer to send regular callbacks to this grain. This timer will keep the current grain from being deactivated. |
RegisterTimer(Func<Object,Task>, Object, TimeSpan, TimeSpan, String)
- Source:
- SystemTarget.cs
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.
Applies to
RegisterTimer(Func<Object,Task>, Object, TimeSpan, TimeSpan)
Registers a timer to send regular callbacks to this grain. This timer will keep the current grain from being deactivated.
public Orleans.Runtime.IGrainTimer RegisterTimer (Func<object,System.Threading.Tasks.Task> callback, object state, TimeSpan dueTime, TimeSpan period);
member this.RegisterTimer : Func<obj, System.Threading.Tasks.Task> * obj * TimeSpan * TimeSpan -> Orleans.Runtime.IGrainTimer
Public Function RegisterTimer (callback As Func(Of Object, Task), state As Object, dueTime As TimeSpan, period As TimeSpan) As IGrainTimer
Parameters
- state
- Object
The state object passed to the callback.
- dueTime
- TimeSpan
The amount of time to delay before the callback
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 callback
.
Specify InfiniteTimeSpan to disable periodic signaling.
Returns
An IDisposable object which will cancel the timer upon disposal.