RegisterTimer(Func<object?, Task>, object?, TimeSpan, TimeSpan)
public IGrainTimer RegisterTimer(Func<object?, Task> callback, object? state, TimeSpan dueTime, TimeSpan period) Registers a timer to send regular callbacks to this system target.
Parameters
callbackFunc<object?, Task>- The timer callback, which will fire whenever the timer becomes due.
stateobject?- The state object passed to the callback.
dueTimeTimeSpan- The amount of time to delay before the
callbackis invoked. SpecifySystem.Threading.Timeout.InfiniteTimeSpanto prevent the timer from starting. SpecifySystem.TimeSpan.Zeroto invoke the callback promptly. periodTimeSpan- The time interval between invocations of
callback. SpecifySystem.Threading.Timeout.InfiniteTimeSpanto disable periodic signaling.
Returns
An
System.IDisposable object which will cancel the timer upon disposal. 