Düzenle

Aracılığıyla paylaş


ITimerRegistry.RegisterTimer Method

Definition

Overloads

RegisterTimer(Grain, Func<Object,Task>, Object, TimeSpan, TimeSpan)
RegisterTimer(IGrainContext, Func<Object,Task>, Object, TimeSpan, TimeSpan)
Obsolete.

Creates a grain timer.

RegisterTimer(Grain, Func<Object,Task>, Object, TimeSpan, TimeSpan)

Source:
ITimerRegistry.cs
public IDisposable RegisterTimer (Orleans.Grain grain, Func<object,System.Threading.Tasks.Task> asyncCallback, object state, TimeSpan dueTime, TimeSpan period);
abstract member RegisterTimer : Orleans.Grain * Func<obj, System.Threading.Tasks.Task> * obj * TimeSpan * TimeSpan -> IDisposable
Public Function RegisterTimer (grain As Grain, asyncCallback As Func(Of Object, Task), state As Object, dueTime As TimeSpan, period As TimeSpan) As IDisposable

Parameters

grain
Grain
asyncCallback
Func<Object,Task>
state
Object
dueTime
TimeSpan
period
TimeSpan

Returns

Applies to

RegisterTimer(IGrainContext, Func<Object,Task>, Object, TimeSpan, TimeSpan)

Caution

Use 'RegisterGrainTimer(grainContext, callback, state, new() { DueTime = dueTime, Period = period, Interleave = true })' instead.

Creates a grain timer.

public IDisposable RegisterTimer (Orleans.Runtime.IGrainContext grainContext, Func<object,System.Threading.Tasks.Task> asyncCallback, object state, TimeSpan dueTime, TimeSpan period);
[System.Obsolete("Use 'RegisterGrainTimer(grainContext, callback, state, new() { DueTime = dueTime, Period = period, Interleave = true })' instead.")]
public IDisposable RegisterTimer (Orleans.Runtime.IGrainContext grainContext, Func<object?,System.Threading.Tasks.Task> callback, object? state, TimeSpan dueTime, TimeSpan period);
abstract member RegisterTimer : Orleans.Runtime.IGrainContext * Func<obj, System.Threading.Tasks.Task> * obj * TimeSpan * TimeSpan -> IDisposable
[<System.Obsolete("Use 'RegisterGrainTimer(grainContext, callback, state, new() { DueTime = dueTime, Period = period, Interleave = true })' instead.")>]
abstract member RegisterTimer : Orleans.Runtime.IGrainContext * Func<obj, System.Threading.Tasks.Task> * obj * TimeSpan * TimeSpan -> IDisposable
Public Function RegisterTimer (grainContext As IGrainContext, asyncCallback As Func(Of Object, Task), state As Object, dueTime As TimeSpan, period As TimeSpan) As IDisposable
Public Function RegisterTimer (grainContext As IGrainContext, callback As Func(Of Object, Task), state As Object, dueTime As TimeSpan, period As TimeSpan) As IDisposable

Parameters

grainContext
IGrainContext

The grain which the timer is associated with.

asyncCallbackcallback
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 instance which represents the timer.

Attributes

Applies to