Edit

Share via


SystemTarget.RegisterTimer Method

Definition

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

asyncCallback
Func<Object,Task>

The timer callback, which will fire whenever the timer becomes due.

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

callback
Func<Object,Task>

The timer callback, which will fire whenever the timer becomes due.

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.

Applies to