Skip to content

Commit 5689315

Browse files
authored
Merge pull request #114465 from erikadoyle/sftimers
Clarify updates for SF timers, reminders
2 parents b7f2bdc + e619600 commit 5689315

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

articles/service-fabric/service-fabric-reliable-actors-timers-reminders.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
22
title: Reliable Actors timers and reminders
33
description: Introduction to timers and reminders for Service Fabric Reliable Actors, including guidance on when to use each.
4-
author: vturecek
5-
64
ms.topic: conceptual
75
ms.date: 11/02/2017
8-
ms.author: vturecek
96
---
107
# Actor timers and reminders
118
Actors can schedule periodic work on themselves by registering either timers or reminders. This article shows how to use timers and reminders and explains the differences between them.
@@ -117,12 +114,17 @@ The next period of the timer starts after the callback completes execution. This
117114

118115
The Actors runtime saves changes made to the actor's State Manager when the callback finishes. If an error occurs in saving the state, that actor object will be deactivated and a new instance will be activated.
119116

117+
Unlike [reminders](#actor-reminders), timers can't be updated. If `RegisterTimer` is called again, a new timer will be registered.
118+
120119
All timers are stopped when the actor is deactivated as part of garbage collection. No timer callbacks are invoked after that. Also, the Actors runtime does not retain any information about the timers that were running before deactivation. It is up to the actor to register any timers that it needs when it is reactivated in the future. For more information, see the section on [actor garbage collection](service-fabric-reliable-actors-lifecycle.md).
121120

122121
## Actor reminders
123-
Reminders are a mechanism to trigger persistent callbacks on an actor at specified times. Their functionality is similar to timers. But unlike timers, reminders are triggered under all circumstances until the actor explicitly unregisters them or the actor is explicitly deleted. Specifically, reminders are triggered across actor deactivations and failovers because the Actors runtime persists information about the actor's reminders using actor state provider. Please note that the reliability of reminders is tied to the state reliability guarantees provided by the actor state provider. This means that for actors whose state persistence is set to None, the reminders will not fire after a failover.
122+
Reminders are a mechanism to trigger persistent callbacks on an actor at specified times. Their functionality is similar to timers. But unlike timers, reminders are triggered under all circumstances until the actor explicitly unregisters them or the actor is explicitly deleted. Specifically, reminders are triggered across actor deactivations and failovers because the Actors runtime persists information about the actor's reminders using actor state provider. Also unlike timers, existing reminders can be updated by calling the registration method (`RegisterReminderAsync`) again using the same *reminderName*.
123+
124+
> [!NOTE]
125+
> The reliability of reminders is tied to the state reliability guarantees provided by the actor state provider. This means that for actors whose state persistence is set to *None*, the reminders will not fire after a failover.
124126
125-
To register a reminder, an actor calls the `RegisterReminderAsync` method provided on the base class, as shown in the following example:
127+
To register a reminder, an actor calls the [`RegisterReminderAsync`](https://docs.microsoft.com/dotnet/api/microsoft.servicefabric.actors.runtime.actorbase.registerreminderasync?view=azure-dotnet#remarks) method provided on the base class, as shown in the following example:
126128

127129
```csharp
128130
protected override async Task OnActivateAsync()

0 commit comments

Comments
 (0)