mirror of https://github.com/dapr/quickstarts.git
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:
commit
041b47c6cb
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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") {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue