From 62bd08b1b72512a9201ba85020e440aa0cc7a1f0 Mon Sep 17 00:00:00 2001 From: Martin Tomka Date: Tue, 5 Sep 2023 19:50:02 +0200 Subject: [PATCH] Use proactive term instead of non-reactive --- src/Polly.Core/README.md | 23 +++++++++---------- .../ResiliencePipelineBuilderExtensions.cs | 2 +- src/Polly.Core/ResilienceStrategy.cs | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/Polly.Core/README.md b/src/Polly.Core/README.md index b3b20a2e041..7ceeaced0a0 100644 --- a/src/Polly.Core/README.md +++ b/src/Polly.Core/README.md @@ -64,12 +64,12 @@ The `ResiliencePipeline` class unifies the four different policies that were ava The resilience pipeline may consist of one or more individual resilience strategies. Polly V8 categorizes resilience strategies into the following building blocks: -- `ResilienceStrategy`: Base class for all non-reactive resilience strategies. +- `ResilienceStrategy`: Base class for all proactive resilience strategies. - `ResilienceStrategy`: Base class for all reactive resilience strategies. -### Example: Custom Non-Reactive Strategy +### Example: Custom Proactive Strategy -Here's an example of a non-reactive strategy that executes a user-provided callback: +Here's an example of a proactive strategy that executes a user-provided callback: ```cs @@ -157,7 +157,7 @@ public class MyCustomStrategyOptions : ResilienceStrategyOptions To gain insights into implementing custom resilience strategies, you can explore the following Polly strategy examples: - [**Retry**](Retry/): Demonstrates how to implement a reactive resilience strategy. -- [**Timeout**](Timeout/): Provides guidance on implementing a non-reactive resilience strategy. +- [**Timeout**](Timeout/): Provides guidance on implementing a proactive resilience strategy. - [**Extensibility Sample**](../../samples/Extensibility/): Offers a practical example of creating a custom resilience strategy. ## Resilience Strategy Delegates @@ -170,29 +170,28 @@ Individual resilience strategies make use of several delegate types: Recommended signatures for these delegates are: -**Predicates** +### Predicates - `Func, ValueTask>` (Reactive) -**Events** +### Events - `Func, ValueTask>` (Reactive) -- `Func` (Non-Reactive) +- `Func` (Proactive) -**Generators** +### Generators - `Func, ValueTask>` (Reactive) -- `Func>` (Non-Reactive) +- `Func>` (Proactive) +### Delegate Arguments These delegates accept either `Args` or `Args` arguments, which encapsulate event information. Note that all these delegates are asynchronous and return a `ValueTask`. > [!NOTE] > When setting up delegates, consider using the `ResilienceContext.ContinueOnCapturedContext` property if your user code interacts with a synchronization context (as in asynchronous UI applications like Windows Forms or WPF). -### Delegate Arguments - -For non-reactive strategies, the `Args` structure might resemble: +For proactive strategies, the `Args` structure might resemble: ```cs diff --git a/src/Polly.Core/ResiliencePipelineBuilderExtensions.cs b/src/Polly.Core/ResiliencePipelineBuilderExtensions.cs index 513d7a03d76..14f2adfa92c 100644 --- a/src/Polly.Core/ResiliencePipelineBuilderExtensions.cs +++ b/src/Polly.Core/ResiliencePipelineBuilderExtensions.cs @@ -55,7 +55,7 @@ public static ResiliencePipelineBuilder AddPipeline(this Resil } /// - /// Adds a non-reactive strategy to the builder. + /// Adds a proactive resilience strategy to the builder. /// /// The builder type. /// The builder instance. diff --git a/src/Polly.Core/ResilienceStrategy.cs b/src/Polly.Core/ResilienceStrategy.cs index ffc62133563..6f7a9c135bc 100644 --- a/src/Polly.Core/ResilienceStrategy.cs +++ b/src/Polly.Core/ResilienceStrategy.cs @@ -1,12 +1,12 @@ namespace Polly; /// -/// Base class for all non-reactive resilience strategies. +/// Base class for all proactive resilience strategies. /// public abstract class ResilienceStrategy { /// - /// An implementation of a non-reactive resilience strategy that executes the specified . + /// An implementation of a proactive resilience strategy that executes the specified . /// /// The type of result returned by the callback. /// The type of state associated with the callback.