From 87bf5fc4f7b7940010009ee87954a779fdde35e1 Mon Sep 17 00:00:00 2001 From: Martin Tomka Date: Tue, 15 Aug 2023 14:39:56 +0200 Subject: [PATCH 1/2] Improve documentation --- .../CircuitBreaker/CircuitBreakerStrategyOptions.TResult.cs | 2 +- src/Polly.Core/Fallback/FallbackStrategyOptions.TResult.cs | 4 ++-- src/Polly.Core/Hedging/HedgingStrategyOptions.TResult.cs | 6 +++--- src/Polly.Core/Retry/RetryStrategyOptions.TResult.cs | 6 +++--- src/Polly.Core/Timeout/TimeoutStrategyOptions.cs | 4 ++-- src/Polly.RateLimiting/RateLimiterStrategyOptions.cs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Polly.Core/CircuitBreaker/CircuitBreakerStrategyOptions.TResult.cs b/src/Polly.Core/CircuitBreaker/CircuitBreakerStrategyOptions.TResult.cs index 42e47cf7de2..b592ac05911 100644 --- a/src/Polly.Core/CircuitBreaker/CircuitBreakerStrategyOptions.TResult.cs +++ b/src/Polly.Core/CircuitBreaker/CircuitBreakerStrategyOptions.TResult.cs @@ -70,7 +70,7 @@ public class CircuitBreakerStrategyOptions : ResilienceStrategyOptions #pragma warning restore /// - /// Gets or sets the predicates for the circuit breaker. + /// Gets or sets a predicate that determines whether the outcome should be handled by the circuit breaker. /// /// /// The default value is a predicate that handles circuit breaker on any exception except . diff --git a/src/Polly.Core/Fallback/FallbackStrategyOptions.TResult.cs b/src/Polly.Core/Fallback/FallbackStrategyOptions.TResult.cs index 687f4e85ac9..8bcf900a000 100644 --- a/src/Polly.Core/Fallback/FallbackStrategyOptions.TResult.cs +++ b/src/Polly.Core/Fallback/FallbackStrategyOptions.TResult.cs @@ -14,7 +14,7 @@ public class FallbackStrategyOptions : ResilienceStrategyOptions public FallbackStrategyOptions() => Name = FallbackConstants.DefaultName; /// - /// Gets or sets the outcome predicate for determining whether a fallback should be executed. + /// Gets or sets a predicate that determines whether the fallback should be executed for a given outcome. /// /// /// The default value is a predicate that fallbacks on any exception except . This property is required. @@ -32,7 +32,7 @@ public class FallbackStrategyOptions : ResilienceStrategyOptions public Func, ValueTask>>? FallbackAction { get; set; } /// - /// Gets or sets the outcome event instance responsible for triggering fallback events. + /// Gets or sets event delegate that is raised when fallback happens. /// /// /// The default value is instance. diff --git a/src/Polly.Core/Hedging/HedgingStrategyOptions.TResult.cs b/src/Polly.Core/Hedging/HedgingStrategyOptions.TResult.cs index 45d80b94ecc..70596a10762 100644 --- a/src/Polly.Core/Hedging/HedgingStrategyOptions.TResult.cs +++ b/src/Polly.Core/Hedging/HedgingStrategyOptions.TResult.cs @@ -41,7 +41,7 @@ public class HedgingStrategyOptions : ResilienceStrategyOptions public int MaxHedgedAttempts { get; set; } = HedgingConstants.DefaultMaxHedgedAttempts; /// - /// Gets or sets the predicate that determines whether a hedging should be performed for a given result. + /// Gets or sets a predicate that determines whether the hedging should be executed for a given outcome. /// /// /// The default value is a predicate that hedges on any exception except . @@ -51,7 +51,7 @@ public class HedgingStrategyOptions : ResilienceStrategyOptions public Func, ValueTask> ShouldHandle { get; set; } = DefaultPredicates.HandleOutcome; /// - /// Gets or sets the hedging action generator that creates hedged actions. + /// Gets or sets a generator that creates hedged actions. /// /// /// The default generator executes the original callback that was passed to the hedging resilience strategy. This property is required. @@ -71,7 +71,7 @@ public class HedgingStrategyOptions : ResilienceStrategyOptions }; /// - /// Gets or sets the generator that generates hedging delays for each hedging attempt. + /// Gets or sets a generator that generates hedging delays for each hedging attempt. /// /// /// The takes precedence over . If specified, the is ignored. diff --git a/src/Polly.Core/Retry/RetryStrategyOptions.TResult.cs b/src/Polly.Core/Retry/RetryStrategyOptions.TResult.cs index 4d5b169af21..9d349d1f6be 100644 --- a/src/Polly.Core/Retry/RetryStrategyOptions.TResult.cs +++ b/src/Polly.Core/Retry/RetryStrategyOptions.TResult.cs @@ -73,7 +73,7 @@ public class RetryStrategyOptions : ResilienceStrategyOptions #pragma warning restore IL2026 /// - /// Gets or sets an outcome predicate that is used to register the predicates to determine if a retry should be performed. + /// Gets or sets a predicate that determines whether the retry should be executed for a given outcome. /// /// /// The default is a delegate that retries on any exception except . This property is required. @@ -82,7 +82,7 @@ public class RetryStrategyOptions : ResilienceStrategyOptions public Func, ValueTask> ShouldHandle { get; set; } = DefaultPredicates.HandleOutcome; /// - /// Gets or sets the generator instance that is used to calculate the time between retries. + /// Gets or sets a generator instance that calculates the time between retries. /// /// /// The generator has precedence over and . @@ -93,7 +93,7 @@ public class RetryStrategyOptions : ResilienceStrategyOptions public Func, ValueTask>? RetryDelayGenerator { get; set; } /// - /// Gets or sets an outcome event that is used to register on-retry callbacks. + /// Gets or sets an event delegate that is raised when the retry happens. /// /// /// After this event, the result produced the by user-callback is discarded and disposed to prevent resource over-consumption. If diff --git a/src/Polly.Core/Timeout/TimeoutStrategyOptions.cs b/src/Polly.Core/Timeout/TimeoutStrategyOptions.cs index 3edcc597a87..34ba3ef06bb 100644 --- a/src/Polly.Core/Timeout/TimeoutStrategyOptions.cs +++ b/src/Polly.Core/Timeout/TimeoutStrategyOptions.cs @@ -24,7 +24,7 @@ public class TimeoutStrategyOptions : ResilienceStrategyOptions #pragma warning restore IL2026 /// - /// Gets or sets the timeout generator that generates the timeout for a given execution. + /// Gets or sets a timeout generator that generates the timeout for a given execution. /// /// /// If generator returns a value that is less or equal to @@ -39,7 +39,7 @@ public class TimeoutStrategyOptions : ResilienceStrategyOptions public Func>? TimeoutGenerator { get; set; } /// - /// Gets or sets the timeout that's raised when timeout occurs. + /// Gets or sets the timeout delegate that raised when timeout occurs. /// /// /// The default value is . diff --git a/src/Polly.RateLimiting/RateLimiterStrategyOptions.cs b/src/Polly.RateLimiting/RateLimiterStrategyOptions.cs index 8bc850c2d51..132cbdfa4c3 100644 --- a/src/Polly.RateLimiting/RateLimiterStrategyOptions.cs +++ b/src/Polly.RateLimiting/RateLimiterStrategyOptions.cs @@ -39,7 +39,7 @@ public class RateLimiterStrategyOptions : ResilienceStrategyOptions public Func? OnRejected { get; set; } /// - /// Gets or sets the rate limiter that the strategy uses. + /// Gets or sets a rate limiter use by the strategy. /// /// /// The default value is . If this property is , then the strategy From 720677c705f19d03054156c24a1b9bc1e1f8c542 Mon Sep 17 00:00:00 2001 From: Martin Tomka Date: Tue, 15 Aug 2023 14:41:17 +0200 Subject: [PATCH 2/2] cleanup --- src/Polly.RateLimiting/RateLimiterStrategyOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Polly.RateLimiting/RateLimiterStrategyOptions.cs b/src/Polly.RateLimiting/RateLimiterStrategyOptions.cs index 132cbdfa4c3..050b6de14c2 100644 --- a/src/Polly.RateLimiting/RateLimiterStrategyOptions.cs +++ b/src/Polly.RateLimiting/RateLimiterStrategyOptions.cs @@ -39,7 +39,7 @@ public class RateLimiterStrategyOptions : ResilienceStrategyOptions public Func? OnRejected { get; set; } /// - /// Gets or sets a rate limiter use by the strategy. + /// Gets or sets a rate limiter used by the strategy. /// /// /// The default value is . If this property is , then the strategy