Merge branch 'master' of github.com:paulyuk/quickstarts into actors-tests

Signed-off-by: Paul Yuknewicz <paulyuk@Pauls-MBP-2.lan>
This commit is contained in:
Paul Yuknewicz 2023-05-22 16:54:26 -07:00
commit 041b47c6cb
3 changed files with 8 additions and 4 deletions

View File

@ -5,7 +5,7 @@ Let's take a look at the Dapr [Actors building block](https://docs.dapr.io/devel
2. Using a SmartDevice.Client console app, developers have a client app to interact with each actor, or the controller to perform actions in aggregate.
3. The SmartDevice.Interfaces contains the shared interfaces and data types used by both service and client apps
> **Note:** This example leverages the Dapr client SDK.
**Note:** This example leverages the Dapr client SDK.
### Step 1: Pre-requisites

View File

@ -65,6 +65,10 @@ internal class ControllerActor : Actor, IController, IRemindable
await this.RegisterReminderAsync("AlarmRefreshReminder", null, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(15));
}
<<<<<<< HEAD
=======
// Callback method for all Reminders. Check the Reminder name for which timer fired.
>>>>>>> f798f88a1be287a171f7743ef47768ac8e2c4fc9
public async Task ReceiveReminderAsync(string reminderName, byte[] state, TimeSpan dueTime, TimeSpan period)
{
if (reminderName == "AlarmRefreshReminder") {

View File

@ -47,8 +47,8 @@ internal class SmokeDetectorActor : Actor, ISmartDevice
/// <param name="data">the user-defined MyData which will be stored into state store as "device_data" state</param>
public async Task<string> SetDataAsync(SmartDeviceData data)
{
// Data is saved to configured state store implicitly after each method execution by Actor's runtime.
// Data can also be saved explicitly by calling this.StateManager.SaveStateAsync();
// Data is saved to configured state store *implicitly* after each method execution by Actor's runtime.
// Data can also be saved *explicitly* by calling this.StateManager.SaveStateAsync();
// State to be saved must be DataContract serializable.
await StateManager.SetStateAsync<SmartDeviceData>(
deviceDataKey,
@ -63,7 +63,7 @@ internal class SmokeDetectorActor : Actor, ISmartDevice
/// <return>the user-defined MyData which is stored into state store as "my_data" state</return>
public async Task<SmartDeviceData> GetDataAsync()
{
// Gets state from the state store.
// Gets current state from the state store.
return await StateManager.GetStateAsync<SmartDeviceData>(deviceDataKey);
}