Skip to content

GrainReminderExtensions Methods

Extension methods for accessing reminders from a Grain or IGrainBase implementation.

GetReminder(Grain, string)

staticextension
View source
public static Task<IGrainReminder?> GetReminder(this Grain grain, string reminderName)
Returns a previously registered reminder.

Parameters

grainGrain
The grain instance.
reminderNamestring
Reminder to return

Returns

Promise for Reminder handle.

GetReminder(IGrainBase, string)

staticextension
View source
public static Task<IGrainReminder?> GetReminder(this IGrainBase grain, string reminderName)
Returns a previously registered reminder.

Parameters

grainIGrainBase
A grain.
reminderNamestring
Reminder to return

Returns

Promise for Reminder handle.

GetReminders(Grain)

staticextension
View source
public static Task<List<IGrainReminder>> GetReminders(this Grain grain)
Returns a list of all reminders registered by the grain.

Parameters

grainGrain

Returns

Promise for list of Reminders registered for this grain.

GetReminders(IGrainBase)

staticextension
View source
public static Task<List<IGrainReminder>> GetReminders(this IGrainBase grain)
Returns a list of all reminders registered by the grain.

Parameters

grainIGrainBase

Returns

Promise for list of Reminders registered for this grain.

RegisterOrUpdateReminder(Grain, string, TimeSpan, TimeSpan)

staticextension
View source
public static Task<IGrainReminder> RegisterOrUpdateReminder(this Grain grain, string reminderName, TimeSpan dueTime, TimeSpan period)
Registers a persistent, reliable reminder to send regular notifications (reminders) to the grain. The grain must implement the Orleans.IRemindable interface, and reminders for this grain will be sent to the ReceiveReminder callback method. If the current grain is deactivated when the timer fires, a new activation of this grain will be created to receive this reminder. If an existing reminder with the same name already exists, that reminder will be overwritten with this new reminder. Reminders will always be received by one activation of this grain, even if multiple activations exist for this grain.

Parameters

grainGrain
The grain instance.
reminderNamestring
Name of this reminder
dueTimeTimeSpan
Due time for this reminder
periodTimeSpan
Frequency period for this reminder

Returns

Promise for Reminder handle.

RegisterOrUpdateReminder(IGrainBase, string, TimeSpan, TimeSpan)

staticextension
View source
public static Task<IGrainReminder> RegisterOrUpdateReminder(this IGrainBase grain, string reminderName, TimeSpan dueTime, TimeSpan period)
Registers a persistent, reliable reminder to send regular notifications (reminders) to the grain. The grain must implement the Orleans.IRemindable interface, and reminders for this grain will be sent to the ReceiveReminder callback method. If the current grain is deactivated when the timer fires, a new activation of this grain will be created to receive this reminder. If an existing reminder with the same name already exists, that reminder will be overwritten with this new reminder. Reminders will always be received by one activation of this grain, even if multiple activations exist for this grain.

Parameters

grainIGrainBase
The grain instance.
reminderNamestring
Name of this reminder
dueTimeTimeSpan
Due time for this reminder
periodTimeSpan
Frequency period for this reminder

Returns

Promise for Reminder handle.

UnregisterReminder(Grain, IGrainReminder)

staticextension
View source
public static Task UnregisterReminder(this Grain grain, IGrainReminder reminder)
Unregisters a previously registered reminder.

Parameters

grainGrain
The grain instance.
reminderIGrainReminder
Reminder to unregister.

Returns

Completion promise for this operation.

UnregisterReminder(IGrainBase, IGrainReminder)

staticextension
View source
public static Task UnregisterReminder(this IGrainBase grain, IGrainReminder reminder)
Unregisters a previously registered reminder.

Parameters

grainIGrainBase
The grain instance.
reminderIGrainReminder
Reminder to unregister.

Returns

Completion promise for this operation.