Compartir vía


Remindable Interface

public interface Remindable

Interface which actors that use reminders must implement.

Method Summary

Modifier and Type Method and Description
CompletableFuture<?> receiveReminderAsync(String reminderName, byte[] context, Duration timeSpan, Duration period)

Reminder call back invoked when an actor reminder is triggered.

Remarks: When a reminder is triggered, Actors runtime will invoke receiveReminderAsync method on the Actor. An actor can register multiple reminders and the ReceiveReminderAsync method is invoked any time any of those reminders is triggered. The actor can use the reminder name that is passed in to the receiveReminderAsync method to figure out which reminder was triggered. The Actors runtime saves the actor state when the receiveReminderAsync call completes. If an error occurs in saving the state, that actor object will be deactivated and a new instance will be activated, to specify that the state need not be saved upon completion of the reminder.

Method Details

receiveReminderAsync

public CompletableFuture receiveReminderAsync(String reminderName, byte[] context, Duration timeSpan, Duration period)

Reminder call back invoked when an actor reminder is triggered.

Remarks: When a reminder is triggered, Actors runtime will invoke receiveReminderAsync method on the Actor. An actor can register multiple reminders and the ReceiveReminderAsync method is invoked any time any of those reminders is triggered. The actor can use the reminder name that is passed in to the receiveReminderAsync method to figure out which reminder was triggered. The Actors runtime saves the actor state when the receiveReminderAsync call completes. If an error occurs in saving the state, that actor object will be deactivated and a new instance will be activated, to specify that the state need not be saved upon completion of the reminder.

Parameters:

reminderName - Name of the reminder.
context - Context associated with this reminder was passed to Actors runtime when reminder was created.
timeSpan - Time when reminder with name reminderName is due
period - The time interval between triggering of reminder with name reminderName.

Returns:

A task that represents the asynchronous operation performed by this callback.

Applies to