SystemTarget.RegisterGrainTimer 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
| RegisterGrainTimer(Func<CancellationToken,Task>, TimeSpan, TimeSpan) |
Registers a timer to send regular callbacks to this system target. |
| RegisterGrainTimer<TState>(Func<TState,CancellationToken,Task>, TState, TimeSpan, TimeSpan) |
Registers a timer to send regular callbacks to this grain. This timer will keep the current grain from being deactivated. |
RegisterGrainTimer(Func<CancellationToken,Task>, TimeSpan, TimeSpan)
Registers a timer to send regular callbacks to this system target.
public Orleans.Runtime.IGrainTimer RegisterGrainTimer(Func<System.Threading.CancellationToken,System.Threading.Tasks.Task> callback, TimeSpan dueTime, TimeSpan period);
member this.RegisterGrainTimer : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task> * TimeSpan * TimeSpan -> Orleans.Runtime.IGrainTimer
Public Function RegisterGrainTimer (callback As Func(Of CancellationToken, Task), dueTime As TimeSpan, period As TimeSpan) As IGrainTimer
Parameters
- callback
- Func<CancellationToken,Task>
The timer callback, which will fire whenever the timer becomes due.
- 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.
Applies to
RegisterGrainTimer<TState>(Func<TState,CancellationToken,Task>, TState, 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 RegisterGrainTimer<TState>(Func<TState,System.Threading.CancellationToken,System.Threading.Tasks.Task> callback, TState state, TimeSpan dueTime, TimeSpan period);
member this.RegisterGrainTimer : Func<'State, System.Threading.CancellationToken, System.Threading.Tasks.Task> * 'State * TimeSpan * TimeSpan -> Orleans.Runtime.IGrainTimer
Public Function RegisterGrainTimer(Of TState) (callback As Func(Of TState, CancellationToken, Task), state As TState, dueTime As TimeSpan, period As TimeSpan) As IGrainTimer
Type Parameters
- TState
Parameters
- callback
- Func<TState,CancellationToken,Task>
The timer callback, which will fire whenever the timer becomes due.
- state
- TState
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.