From e97e27bdd3dfa2a0e67f2235fb92d4d563745974 Mon Sep 17 00:00:00 2001 From: halspang <70976921+halspang@users.noreply.github.com> Date: Thu, 7 Jul 2022 17:58:48 +0000 Subject: [PATCH 1/2] Add docs for .NET SDK per actor type configuration (#2565) * Add docs for .NET SDK per actor type configuration This commit adds an example of how to use the per actor type configuration in the .NET SDK. https://github.com/dapr/docs/issues/2176 Signed-off-by: Hal Spang Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> * Fixed typos * Create howto-actors.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Co-authored-by: Mark Fussell --- .../building-blocks/actors/howto-actors.md | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors.md b/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors.md index d58efccd6..d7adcb47b 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors.md +++ b/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors.md @@ -168,8 +168,8 @@ You can configure the Dapr actor runtime configuration to modify the default run - `actorScanInterval` - The duration which specifies how often to scan for actors to deactivate idle actors. Actors that have been idle longer than actor_idle_timeout will be deactivated. **Default: 30 seconds** - `drainOngoingCallTimeout` - The duration when in the process of draining rebalanced actors. This specifies the timeout for the current active actor method to finish. If there is no current actor method call, this is ignored. **Default: 60 seconds** - `drainRebalancedActors` - If true, Dapr will wait for `drainOngoingCallTimeout` duration to allow a current actor call to complete before trying to deactivate an actor. **Default: true** -- `reentrancy` (ActorReentrancyConfig) - Configure the reentrancy behavior for an actor. If not provided, reentrancy is diabled. **Default: disabled** -**Default: 0** +- `reentrancy` (ActorReentrancyConfig) - Configure the reentrancy behavior for an actor. If not provided, reentrancy is disabled. **Default: disabled** +**Default: false** - `remindersStoragePartitions` - Configure the number of partitions for actor's reminders. If not provided, all reminders are saved as a single record in actor's state store. **Default: 0** - `entitiesConfig` - Configure each actor type individually with an array of configurations. Any entity specified in the individual entity configurations must also be specified in the top level `entities` field. **Default: None** @@ -208,7 +208,19 @@ public void ConfigureServices(IServiceCollection services) options.DrainOngoingCallTimeout = TimeSpan.FromSeconds(60); options.DrainRebalancedActors = true; options.RemindersStoragePartitions = 7; - // reentrancy not implemented in the .NET SDK at this time + options.ReentrancyConfig = new() { Enabled = false }; + + // Add a configuration for a specific actor type. + // This actor type must have a matching value in the base level 'entities' field. If it does not, the configuration will be ignored. + // If there is a matching entity, the values here will be used to overwrite any values specified in the root configuration. + // In this example, `ReentrantActor` has reentrancy enabled; however, 'MyActor' will not have reentrancy enabled. + options.Actors.RegisterActor(typeOptions: new() + { + ReentrancyConfig = new() + { + Enabled = true, + } + }); }); // Register additional services for use with actors @@ -262,9 +274,10 @@ var daprConfigResponse = daprConfig{ Reentrancy: config.ReentrancyConfig{Enabled: false}, EntitiesConfig: []config.EntityConfig{ { + // Add a configuration for a specific actor type. // This actor type must have a matching value in the base level 'entities' field. If it does not, the configuration will be ignored. // If there is a matching entity, the values here will be used to overwrite any values specified in the root configuration. - // In the case of this actor, it will have reentrancy enabled and 'defaultActorType' will not have reentrancy enabled. + // In this example, `reentrantActorType` has reentrancy enabled; however, 'defaultActorType' will not have reentrancy enabled. Entities: []string{reentrantActorType}, Reentrancy: config.ReentrancyConfig{ Enabled: true, @@ -345,7 +358,6 @@ public void ConfigureServices(IServiceCollection services) options.ActorIdleTimeout = TimeSpan.FromMinutes(60); options.ActorScanInterval = TimeSpan.FromSeconds(30); options.RemindersStoragePartitions = 7; - // reentrancy not implemented in the .NET SDK at this time }); // Register additional services for use with actors @@ -424,4 +436,4 @@ Also, **you can only increase the number of partitions**, not decrease. This all Watch [this video for a demo of actor reminder partitioning](https://youtu.be/ZwFOEUYe1WA?t=1493):
- \ No newline at end of file + From b25592ad7d27c622eee7f887d32a3af6b28a039e Mon Sep 17 00:00:00 2001 From: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:16:12 -0500 Subject: [PATCH 2/2] upmerge v1.7 (#2630) Signed-off-by: Hannah Hunter --- .github/workflows/website-root.yml | 1 + .github/workflows/website-v1-8.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/website-root.yml b/.github/workflows/website-root.yml index cec283ad3..faee5156a 100644 --- a/.github/workflows/website-root.yml +++ b/.github/workflows/website-root.yml @@ -18,6 +18,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive + fetch-depth: 0 - name: Setup Docsy run: cd daprdocs && git submodule update --init --recursive && sudo npm install -D --save autoprefixer && sudo npm install -D --save postcss-cli - name: Build And Deploy diff --git a/.github/workflows/website-v1-8.yml b/.github/workflows/website-v1-8.yml index ae6cb9258..c374f6424 100644 --- a/.github/workflows/website-v1-8.yml +++ b/.github/workflows/website-v1-8.yml @@ -18,6 +18,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive + fetch-depth: 0 - name: Setup Docsy run: cd daprdocs && git submodule update --init --recursive && sudo npm install -D --save autoprefixer && sudo npm install -D --save postcss-cli - name: Build And Deploy