Megosztás a következőn keresztül:


ActorBase.RegisterReminderAsync(String, Byte[], TimeSpan, TimeSpan) Method

Definition

Registers a reminder with the actor.

protected System.Threading.Tasks.Task<Microsoft.ServiceFabric.Actors.Runtime.IActorReminder> RegisterReminderAsync (string reminderName, byte[] state, TimeSpan dueTime, TimeSpan period);
member this.RegisterReminderAsync : string * byte[] * TimeSpan * TimeSpan -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Actors.Runtime.IActorReminder>
Protected Function RegisterReminderAsync (reminderName As String, state As Byte(), dueTime As TimeSpan, period As TimeSpan) As Task(Of IActorReminder)

Parameters

reminderName
String

The name of the reminder to register. The name must be unique per actor.

state
Byte[]

User state passed to the reminder invocation.

dueTime
TimeSpan

The amount of time to delay before invoking the reminder for the first time. Specify negative one (-1) milliseconds to disable invocation. Specify zero (0) to invoke the reminder immediately after registration.

period
TimeSpan

The time interval between reminder invocations after the first invocation. Specify negative one (-1) milliseconds to disable periodic invocation.

Returns

A task that represents the asynchronous registration operation. The result of the task provides information about the registered reminder and is used to unregister the reminder using UnregisterReminderAsync(IActorReminder).

Remarks

The class deriving from ActorBase must implement IRemindable to consume reminder invocations. Multiple reminders can be registered at any time, uniquely identified by reminderName. Existing reminders can also be updated by calling this method again. Reminder invocations are synchronized both with other reminders and other actor method callbacks.

Applies to