From 84518b81c6db70612dee12897b7e13d775f72216 Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Thu, 25 Apr 2024 23:33:40 +0300 Subject: [PATCH 01/19] Fix SA1618 by documenting typeparams https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1618.md --- src/Polly/AsyncPolicy.ExecuteOverloads.cs | 3 + .../Bulkhead/AsyncBulkheadTResultSyntax.cs | 4 + src/Polly/Bulkhead/BulkheadPolicy.cs | 1 + src/Polly/Bulkhead/BulkheadTResultSyntax.cs | 4 + src/Polly/Bulkhead/IBulkheadPolicy.cs | 1 + src/Polly/Caching/AsyncCacheTResultSyntax.cs | 30 +++++++ src/Polly/Caching/CachePolicy.cs | 1 + src/Polly/Caching/CacheTResultSyntax.cs | 30 +++++++ src/Polly/Caching/IAsyncCacheProvider.cs | 1 + src/Polly/Caching/ICachePolicy.cs | 1 + src/Polly/Caching/ISyncCacheProvider.cs | 1 + src/Polly/Caching/ITtlStrategy.cs | 1 + .../AdvancedCircuitBreakerTResultSyntax.cs | 4 + ...syncAdvancedCircuitBreakerTResultSyntax.cs | 6 ++ .../AsyncCircuitBreakerTResultSyntax.cs | 6 ++ .../CircuitBreaker/CircuitBreakerPolicy.cs | 1 + .../CircuitBreakerTResultSyntax.cs | 6 ++ .../CircuitBreaker/ICircuitBreakerPolicy.cs | 1 + src/Polly/DelegateResult.cs | 1 + src/Polly/Fallback/AsyncFallbackSyntax.cs | 7 ++ src/Polly/Fallback/FallbackPolicy.cs | 1 + src/Polly/Fallback/FallbackSyntax.cs | 10 +++ src/Polly/Fallback/IFallbackPolicy.cs | 1 + src/Polly/IAsyncPolicy.Extensions.cs | 1 + src/Polly/IAsyncPolicy.cs | 3 + src/Polly/ISyncPolicy.Extensions.cs | 1 + src/Polly/ISyncPolicy.cs | 4 + src/Polly/NoOp/AsyncNoOpPolicy.cs | 1 + src/Polly/NoOp/INoOpPolicy.cs | 1 + src/Polly/Policy.ExecuteOverloads.cs | 4 + src/Polly/PolicyBase.cs | 1 + src/Polly/PolicyResult.cs | 1 + src/Polly/Polly.csproj | 2 +- src/Polly/RateLimit/AsyncRateLimitPolicy.cs | 1 + src/Polly/RateLimit/IRateLimitPolicy.cs | 1 + src/Polly/RateLimit/RateLimitPolicy.cs | 1 + .../Registry/IConcurrentPolicyRegistry.cs | 4 + src/Polly/Registry/PolicyRegistry.cs | 4 + .../ResiliencePipelineConversionExtensions.cs | 2 + src/Polly/ResultPredicates.cs | 1 + src/Polly/Retry/AsyncRetryPolicy.cs | 1 + src/Polly/Retry/AsyncRetrySyntax.cs | 28 +++---- src/Polly/Retry/AsyncRetryTResultSyntax.cs | 78 +++++++++++++++---- src/Polly/Retry/IRetryPolicy.cs | 1 + src/Polly/Retry/RetryPolicy.cs | 1 + src/Polly/Retry/RetrySyntax.cs | 20 ++--- src/Polly/Retry/RetryTResultSyntax.cs | 57 +++++++++++--- .../Timeout/AsyncTimeoutTResultSyntax.cs | 24 ++++++ src/Polly/Timeout/ITimeoutPolicy.cs | 1 + src/Polly/Timeout/TimeoutPolicy.cs | 1 + src/Polly/Timeout/TimeoutTResultSyntax.cs | 11 +++ src/Polly/Wrap/AsyncPolicyWrapSyntax.cs | 3 + src/Polly/Wrap/IPolicyWrap.cs | 1 + src/Polly/Wrap/PolicyWrapSyntax.cs | 3 + 54 files changed, 334 insertions(+), 51 deletions(-) diff --git a/src/Polly/AsyncPolicy.ExecuteOverloads.cs b/src/Polly/AsyncPolicy.ExecuteOverloads.cs index 744a3dfb869..661cfadf64b 100644 --- a/src/Polly/AsyncPolicy.ExecuteOverloads.cs +++ b/src/Polly/AsyncPolicy.ExecuteOverloads.cs @@ -123,6 +123,7 @@ public Task ExecuteAsync(Func> action) => /// /// Executes the specified asynchronous action within the policy and returns the result. /// + /// The type of the result. /// The action to perform. /// Arbitrary data that is passed to the exception policy. /// The value returned by the action. @@ -155,6 +156,7 @@ public Task ExecuteAsync(Func /// /// Executes the specified asynchronous action within the policy and returns the result. /// + /// The type of the result. /// The action to perform. /// Arbitrary data that is passed to the exception policy. /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. @@ -191,6 +193,7 @@ public Task ExecuteAsync(Func /// /// Executes the specified asynchronous action within the policy and returns the result. /// + /// The type of the result. /// The action to perform. /// Arbitrary data that is passed to the exception policy. /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. diff --git a/src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs b/src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs index b31a35104fb..ee3f43ccfb3 100644 --- a/src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs +++ b/src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs @@ -7,6 +7,7 @@ public partial class Policy /// Builds a bulkhead isolation , which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system. /// When an execution would cause the number of actions executing concurrently through the policy to exceed , the action is not executed and a is thrown. /// + /// The type of the result. /// The maximum number of concurrent actions that may be executing through the policy. /// The policy instance. public static AsyncBulkheadPolicy BulkheadAsync(int maxParallelization) @@ -19,6 +20,7 @@ public static AsyncBulkheadPolicy BulkheadAsync(int maxParalle /// Builds a bulkhead isolation , which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system. /// When an execution would cause the number of actions executing concurrently through the policy to exceed , the action is not executed and a is thrown. /// + /// The type of the result. /// The maximum number of concurrent actions that may be executing through the policy. /// An action to call asynchronously, if the bulkhead rejects execution due to oversubscription. /// maxParallelization;Value must be greater than zero. @@ -31,6 +33,7 @@ public static AsyncBulkheadPolicy BulkheadAsync(int maxParalle /// Builds a bulkhead isolation , which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system. /// When an execution would cause the number of actions executing concurrently through the policy to exceed , the policy allows a further executions to queue, waiting for a concurrent execution slot. When an execution would cause the number of queuing actions to exceed , a is thrown. /// + /// The type of the result. /// The maximum number of concurrent actions that may be executing through the policy. /// The maximum number of actions that may be queuing, waiting for an execution slot. /// The policy instance. @@ -46,6 +49,7 @@ public static AsyncBulkheadPolicy BulkheadAsync(int maxParalle /// Builds a bulkhead isolation , which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system. /// When an execution would cause the number of actions executing concurrently through the policy to exceed , the policy allows a further executions to queue, waiting for a concurrent execution slot. When an execution would cause the number of queuing actions to exceed , a is thrown. /// + /// The type of the result. /// The maximum number of concurrent actions that may be executing through the policy. /// The maximum number of actions that may be queuing, waiting for an execution slot. /// An action to call asynchronously, if the bulkhead rejects execution due to oversubscription. diff --git a/src/Polly/Bulkhead/BulkheadPolicy.cs b/src/Polly/Bulkhead/BulkheadPolicy.cs index 35c3dd0963b..9d769025267 100644 --- a/src/Polly/Bulkhead/BulkheadPolicy.cs +++ b/src/Polly/Bulkhead/BulkheadPolicy.cs @@ -51,6 +51,7 @@ public void Dispose() /// /// A bulkhead-isolation policy which can be applied to delegates returning a value of type . /// +/// The type of the result. public class BulkheadPolicy : Policy, IBulkheadPolicy { private readonly SemaphoreSlim _maxParallelizationSemaphore; diff --git a/src/Polly/Bulkhead/BulkheadTResultSyntax.cs b/src/Polly/Bulkhead/BulkheadTResultSyntax.cs index d5918091faf..19f7efe267c 100644 --- a/src/Polly/Bulkhead/BulkheadTResultSyntax.cs +++ b/src/Polly/Bulkhead/BulkheadTResultSyntax.cs @@ -7,6 +7,7 @@ public partial class Policy /// Builds a bulkhead isolation , which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system. /// When an execution would cause the number of actions executing concurrently through the policy to exceed , the action is not executed and a is thrown. /// + /// The type of the result. /// The maximum number of concurrent actions that may be executing through the policy. /// maxParallelization;Value must be greater than zero. /// The policy instance. @@ -20,6 +21,7 @@ public static BulkheadPolicy Bulkhead(int maxParallelization) /// Builds a bulkhead isolation , which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system. /// When an execution would cause the number of actions executing concurrently through the policy to exceed , the action is not executed and a is thrown. /// + /// The type of the result. /// The maximum number of concurrent actions that may be executing through the policy. /// An action to call, if the bulkhead rejects execution due to oversubscription. /// maxParallelization;Value must be greater than zero. @@ -32,6 +34,7 @@ public static BulkheadPolicy Bulkhead(int maxParallelization, /// Builds a bulkhead isolation , which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system. /// When an execution would cause the number of actions executing concurrently through the policy to exceed , the policy allows a further executions to queue, waiting for a concurrent execution slot. When an execution would cause the number of queuing actions to exceed , a is thrown. /// + /// The type of the result. /// The maximum number of concurrent actions that may be executing through the policy. /// The maximum number of actions that may be queuing, waiting for an execution slot. /// The policy instance. @@ -47,6 +50,7 @@ public static BulkheadPolicy Bulkhead(int maxParallelization, /// Builds a bulkhead isolation , which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system. /// When an execution would cause the number of actions executing concurrently through the policy to exceed , the policy allows a further executions to queue, waiting for a concurrent execution slot. When an execution would cause the number of queuing actions to exceed , a is thrown. /// + /// The type of the result. /// The maximum number of concurrent actions that may be executing through the policy. /// The maximum number of actions that may be queuing, waiting for an execution slot. /// An action to call, if the bulkhead rejects execution due to oversubscription. diff --git a/src/Polly/Bulkhead/IBulkheadPolicy.cs b/src/Polly/Bulkhead/IBulkheadPolicy.cs index c2a8996c21f..127896b2aae 100644 --- a/src/Polly/Bulkhead/IBulkheadPolicy.cs +++ b/src/Polly/Bulkhead/IBulkheadPolicy.cs @@ -20,6 +20,7 @@ public interface IBulkheadPolicy : IsPolicy, IDisposable /// /// Defines properties and methods common to all bulkhead policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface IBulkheadPolicy : IBulkheadPolicy { } diff --git a/src/Polly/Caching/AsyncCacheTResultSyntax.cs b/src/Polly/Caching/AsyncCacheTResultSyntax.cs index 91d43c9bbc7..3a4daa6d419 100644 --- a/src/Polly/Caching/AsyncCacheTResultSyntax.cs +++ b/src/Polly/Caching/AsyncCacheTResultSyntax.cs @@ -9,6 +9,7 @@ public partial class Policy /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -28,6 +29,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -48,6 +50,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -69,6 +72,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -91,6 +95,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -112,6 +117,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -134,6 +140,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// Delegate to call on a cache hit, when value is returned from cache. @@ -167,6 +174,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call on a cache hit, when value is returned from cache. @@ -201,6 +209,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -237,6 +246,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -274,6 +284,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -310,6 +321,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -347,6 +359,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -361,6 +374,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -376,6 +390,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -391,6 +406,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -407,6 +423,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -428,6 +445,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -449,6 +467,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -465,6 +484,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -486,6 +506,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -507,6 +528,7 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider< /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// Delegate to call on a cache hit, when value is returned from cache. @@ -536,6 +558,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call on a cache hit, when value is returned from cache. @@ -565,6 +588,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call on a cache hit, when value is returned from cache. @@ -594,6 +618,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -626,6 +651,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -658,6 +684,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -690,6 +717,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -722,6 +750,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -754,6 +783,7 @@ public static AsyncCachePolicy CacheAsync( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. diff --git a/src/Polly/Caching/CachePolicy.cs b/src/Polly/Caching/CachePolicy.cs index da58c7bca24..efd576bc674 100644 --- a/src/Polly/Caching/CachePolicy.cs +++ b/src/Polly/Caching/CachePolicy.cs @@ -62,6 +62,7 @@ protected override TResult Implementation(Func /// A cache policy that can be applied to the results of delegate executions. /// +/// The type of the result. public class CachePolicy : Policy, ICachePolicy { private readonly Action _onCacheGet; diff --git a/src/Polly/Caching/CacheTResultSyntax.cs b/src/Polly/Caching/CacheTResultSyntax.cs index d96ec358335..4f7c6712267 100644 --- a/src/Polly/Caching/CacheTResultSyntax.cs +++ b/src/Polly/Caching/CacheTResultSyntax.cs @@ -9,6 +9,7 @@ public partial class Policy /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -28,6 +29,7 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -48,6 +50,7 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -69,6 +72,7 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -91,6 +95,7 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -112,6 +117,7 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -134,6 +140,7 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// Delegate to call on a cache hit, when value is returned from cache. @@ -167,6 +174,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call on a cache hit, when value is returned from cache. @@ -201,6 +209,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -237,6 +246,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -274,6 +284,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -310,6 +321,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -347,6 +359,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -361,6 +374,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -376,6 +390,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call if an exception is thrown when attempting to get a value from or put a value into the cache, passing the execution context, the cache key, and the exception. @@ -391,6 +406,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -407,6 +423,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -429,6 +446,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -451,6 +469,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -467,6 +486,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -489,6 +509,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -511,6 +532,7 @@ public static CachePolicy Cache(ISyncCacheProvider ca /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// Delegate to call on a cache hit, when value is returned from cache. @@ -540,6 +562,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call on a cache hit, when value is returned from cache. @@ -569,6 +592,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// Delegate to call on a cache hit, when value is returned from cache. @@ -598,6 +622,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -630,6 +655,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -662,6 +688,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -694,6 +721,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// Duration (ttl) for which to cache values. /// The cache key strategy. @@ -726,6 +754,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. @@ -759,6 +788,7 @@ public static CachePolicy Cache( /// If the provides a value from cache, returns that value and does not execute the governed delegate. If the does not provide a value, executes the governed delegate, stores the value with the , then returns the value. /// /// + /// The type of the result. /// The cache provider. /// A strategy for specifying ttl for values to be cached. /// The cache key strategy. diff --git a/src/Polly/Caching/IAsyncCacheProvider.cs b/src/Polly/Caching/IAsyncCacheProvider.cs index 3d390a8ea17..d1fddb20a6c 100644 --- a/src/Polly/Caching/IAsyncCacheProvider.cs +++ b/src/Polly/Caching/IAsyncCacheProvider.cs @@ -33,6 +33,7 @@ public interface IAsyncCacheProvider /// /// Defines methods for classes providing asynchronous cache functionality for Polly s. /// +/// The type of the result. public interface IAsyncCacheProvider { /// diff --git a/src/Polly/Caching/ICachePolicy.cs b/src/Polly/Caching/ICachePolicy.cs index ca01367942f..0f73405cb50 100644 --- a/src/Polly/Caching/ICachePolicy.cs +++ b/src/Polly/Caching/ICachePolicy.cs @@ -11,6 +11,7 @@ public interface ICachePolicy : IsPolicy /// /// Defines properties and methods common to all Cache policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface ICachePolicy : ICachePolicy { } diff --git a/src/Polly/Caching/ISyncCacheProvider.cs b/src/Polly/Caching/ISyncCacheProvider.cs index 6e2eefd6cf3..7c4b87917f2 100644 --- a/src/Polly/Caching/ISyncCacheProvider.cs +++ b/src/Polly/Caching/ISyncCacheProvider.cs @@ -28,6 +28,7 @@ public interface ISyncCacheProvider /// /// Defines methods for classes providing synchronous cache functionality for Polly s. /// +/// The type of the result. public interface ISyncCacheProvider { /// diff --git a/src/Polly/Caching/ITtlStrategy.cs b/src/Polly/Caching/ITtlStrategy.cs index fd911a07ec3..6aeaa60ee97 100644 --- a/src/Polly/Caching/ITtlStrategy.cs +++ b/src/Polly/Caching/ITtlStrategy.cs @@ -11,6 +11,7 @@ public interface ITtlStrategy : ITtlStrategy /// /// Defines a strategy for providing time-to-live durations for cacheable results. /// +/// The type of the result. public interface ITtlStrategy { /// diff --git a/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs b/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs index 8dcc1b870c6..16740fe6472 100644 --- a/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs +++ b/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs @@ -16,6 +16,7 @@ public static class AdvancedCircuitBreakerTResultSyntax /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. @@ -50,6 +51,7 @@ public static CircuitBreakerPolicy AdvancedCircuitBreaker(this /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure. /// The duration of the timeslice over which failure ratios are assessed. @@ -83,6 +85,7 @@ public static CircuitBreakerPolicy AdvancedCircuitBreaker(this /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure. /// The duration of the timeslice over which failure ratios are assessed. @@ -119,6 +122,7 @@ public static CircuitBreakerPolicy AdvancedCircuitBreaker(this /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure. /// The duration of the timeslice over which failure ratios are assessed. diff --git a/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs b/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs index a3efca75b3d..930902fac64 100644 --- a/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs +++ b/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs @@ -16,6 +16,7 @@ public static class AsyncAdvancedCircuitBreakerTResultSyntax /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. @@ -51,6 +52,7 @@ public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. @@ -85,6 +87,7 @@ public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. @@ -124,6 +127,7 @@ public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. @@ -160,6 +164,7 @@ public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. @@ -197,6 +202,7 @@ public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. diff --git a/src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs b/src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs index 71e965a3ada..18b424e0ebc 100644 --- a/src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs +++ b/src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs @@ -17,6 +17,7 @@ public static class AsyncCircuitBreakerTResultSyntax /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -47,6 +48,7 @@ public static AsyncCircuitBreakerPolicy CircuitBreakerAsync(th /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -76,6 +78,7 @@ public static AsyncCircuitBreakerPolicy CircuitBreakerAsync(th /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -110,6 +113,7 @@ public static AsyncCircuitBreakerPolicy CircuitBreakerAsync(th /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -141,6 +145,7 @@ public static AsyncCircuitBreakerPolicy CircuitBreakerAsync(th /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -173,6 +178,7 @@ public static AsyncCircuitBreakerPolicy CircuitBreakerAsync(th /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. diff --git a/src/Polly/CircuitBreaker/CircuitBreakerPolicy.cs b/src/Polly/CircuitBreaker/CircuitBreakerPolicy.cs index 138185ae781..0e356ac181d 100644 --- a/src/Polly/CircuitBreaker/CircuitBreakerPolicy.cs +++ b/src/Polly/CircuitBreaker/CircuitBreakerPolicy.cs @@ -55,6 +55,7 @@ protected override TResult Implementation(Func /// A circuit-breaker policy that can be applied to delegates returning a value of type . /// +/// The type of the result. public class CircuitBreakerPolicy : Policy, ICircuitBreakerPolicy { internal readonly ICircuitController _breakerController; diff --git a/src/Polly/CircuitBreaker/CircuitBreakerTResultSyntax.cs b/src/Polly/CircuitBreaker/CircuitBreakerTResultSyntax.cs index 1f85c40ae67..b001aa2db57 100644 --- a/src/Polly/CircuitBreaker/CircuitBreakerTResultSyntax.cs +++ b/src/Polly/CircuitBreaker/CircuitBreakerTResultSyntax.cs @@ -17,6 +17,7 @@ public static class CircuitBreakerTResultSyntax /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -47,6 +48,7 @@ public static CircuitBreakerPolicy CircuitBreaker(this PolicyB /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -76,6 +78,7 @@ public static CircuitBreakerPolicy CircuitBreaker(this PolicyB /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -109,6 +112,7 @@ public static CircuitBreakerPolicy CircuitBreaker(this PolicyB /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -140,6 +144,7 @@ public static CircuitBreakerPolicy CircuitBreaker(this PolicyB /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. @@ -172,6 +177,7 @@ public static CircuitBreakerPolicy CircuitBreaker(this PolicyB /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// + /// The type of the result. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. diff --git a/src/Polly/CircuitBreaker/ICircuitBreakerPolicy.cs b/src/Polly/CircuitBreaker/ICircuitBreakerPolicy.cs index 2c0f882ac9b..9cf4b8bd839 100644 --- a/src/Polly/CircuitBreaker/ICircuitBreakerPolicy.cs +++ b/src/Polly/CircuitBreaker/ICircuitBreakerPolicy.cs @@ -30,6 +30,7 @@ public interface ICircuitBreakerPolicy : IsPolicy /// /// Defines properties and methods common to all circuit-breaker policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface ICircuitBreakerPolicy : ICircuitBreakerPolicy { /// diff --git a/src/Polly/DelegateResult.cs b/src/Polly/DelegateResult.cs index fc2bc3fc04c..6012b5664db 100644 --- a/src/Polly/DelegateResult.cs +++ b/src/Polly/DelegateResult.cs @@ -3,6 +3,7 @@ /// /// The captured outcome of executing an individual Func<TResult>. /// +/// The type of the result. public class DelegateResult { /// diff --git a/src/Polly/Fallback/AsyncFallbackSyntax.cs b/src/Polly/Fallback/AsyncFallbackSyntax.cs index 31009c0b54a..d0b4cc9de94 100644 --- a/src/Polly/Fallback/AsyncFallbackSyntax.cs +++ b/src/Polly/Fallback/AsyncFallbackSyntax.cs @@ -93,6 +93,7 @@ public static class AsyncFallbackTResultSyntax /// /// Builds an which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, returns . /// + /// The type of the result. /// The policy builder. /// The fallback value to provide. /// The policy instance. @@ -107,6 +108,7 @@ public static AsyncFallbackPolicy FallbackAsync(this PolicyBui /// /// Builds an which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, asynchronously calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback delegate. /// Thrown when is . @@ -125,6 +127,7 @@ public static AsyncFallbackPolicy FallbackAsync(this PolicyBui /// /// Builds an which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, first asynchronously calls with details of the handled exception or result; then returns . /// + /// The type of the result. /// The policy builder. /// The fallback value to provide. /// The action to call asynchronously before invoking the fallback delegate. @@ -143,6 +146,7 @@ public static AsyncFallbackPolicy FallbackAsync(this PolicyBui /// /// Builds an which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, first asynchronously calls with details of the handled exception or result; then asynchronously calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback delegate. /// The action to call asynchronously before invoking the fallback delegate. @@ -164,6 +168,7 @@ public static AsyncFallbackPolicy FallbackAsync(this PolicyBui /// /// Builds an which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, first asynchronously calls with details of the handled exception or result and the execution context; then returns . /// + /// The type of the result. /// The policy builder. /// The fallback value to provide. /// The action to call asynchronously before invoking the fallback delegate. @@ -182,6 +187,7 @@ public static AsyncFallbackPolicy FallbackAsync(this PolicyBui /// /// Builds an which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, first asynchronously calls with details of the handled exception or result and the execution context; then asynchronously calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback delegate. /// The action to call asynchronously before invoking the fallback delegate. @@ -201,6 +207,7 @@ public static AsyncFallbackPolicy FallbackAsync(this PolicyBui /// /// Builds an which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, first asynchronously calls with details of the handled exception or result and the execution context; then asynchronously calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback delegate. /// The action to call asynchronously before invoking the fallback delegate. diff --git a/src/Polly/Fallback/FallbackPolicy.cs b/src/Polly/Fallback/FallbackPolicy.cs index 56fe7c91e72..3deeaeea9f0 100644 --- a/src/Polly/Fallback/FallbackPolicy.cs +++ b/src/Polly/Fallback/FallbackPolicy.cs @@ -48,6 +48,7 @@ protected override TResult Implementation(Func /// A fallback policy that can be applied to delegates returning a value of type . /// +/// The type of the result. public class FallbackPolicy : Policy, IFallbackPolicy { private readonly Action, Context> _onFallback; diff --git a/src/Polly/Fallback/FallbackSyntax.cs b/src/Polly/Fallback/FallbackSyntax.cs index d64ae981854..91143eaa60d 100644 --- a/src/Polly/Fallback/FallbackSyntax.cs +++ b/src/Polly/Fallback/FallbackSyntax.cs @@ -146,6 +146,7 @@ public static class FallbackTResultSyntax /// /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, returns instead. /// + /// The type of the result. /// The policy builder. /// The fallback value to provide. /// The policy instance. @@ -158,6 +159,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback action. /// Thrown when is . @@ -174,6 +176,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback action. /// Thrown when is . @@ -190,6 +193,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result; then returns . /// + /// The type of the result. /// The policy builder. /// The fallback value to provide. /// The action to call before invoking the fallback delegate. @@ -206,6 +210,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result; then calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback action. /// The action to call before invoking the fallback delegate. @@ -225,6 +230,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result; then calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback action. /// The action to call before invoking the fallback delegate. @@ -244,6 +250,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result and the execution context; then returns . /// + /// The type of the result. /// The policy builder. /// The fallback value to provide. /// The action to call before invoking the fallback delegate. @@ -260,6 +267,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result and the execution context; then calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback action. /// The action to call before invoking the fallback delegate. @@ -279,6 +287,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result and the execution context; then calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback action. /// The action to call before invoking the fallback delegate. @@ -298,6 +307,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result and the execution context; then calls and returns its result. /// + /// The type of the result. /// The policy builder. /// The fallback action. /// The action to call before invoking the fallback delegate. diff --git a/src/Polly/Fallback/IFallbackPolicy.cs b/src/Polly/Fallback/IFallbackPolicy.cs index 19ce1103863..102fdd58624 100644 --- a/src/Polly/Fallback/IFallbackPolicy.cs +++ b/src/Polly/Fallback/IFallbackPolicy.cs @@ -12,6 +12,7 @@ public interface IFallbackPolicy : IsPolicy /// /// Defines properties and methods common to all Fallback policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface IFallbackPolicy : IFallbackPolicy { } diff --git a/src/Polly/IAsyncPolicy.Extensions.cs b/src/Polly/IAsyncPolicy.Extensions.cs index c3b888bd49d..2e6974d919c 100644 --- a/src/Polly/IAsyncPolicy.Extensions.cs +++ b/src/Polly/IAsyncPolicy.Extensions.cs @@ -9,6 +9,7 @@ public static class IAsyncPolicyExtensions /// Converts a non-generic into a generic for handling only executions returning . /// /// This method allows you to convert a non-generic into a generic for contexts such as variables or parameters which may explicitly require a generic . + /// The type of the result. /// The non-generic to convert to a generic . /// A generic version of the supplied non-generic . public static IAsyncPolicy AsAsyncPolicy(this IAsyncPolicy policy) => diff --git a/src/Polly/IAsyncPolicy.cs b/src/Polly/IAsyncPolicy.cs index faa75d2f241..387650d7410 100644 --- a/src/Polly/IAsyncPolicy.cs +++ b/src/Polly/IAsyncPolicy.cs @@ -104,6 +104,7 @@ public interface IAsyncPolicy : IsPolicy /// /// Executes the specified asynchronous action within the policy and returns the result. /// + /// The type of the result. /// The action to perform. /// Arbitrary data that is passed to the exception policy. /// The value returned by the action. @@ -121,6 +122,7 @@ public interface IAsyncPolicy : IsPolicy /// /// Executes the specified asynchronous action within the policy and returns the result. /// + /// The type of the result. /// The action to perform. /// Arbitrary data that is passed to the exception policy. /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. @@ -151,6 +153,7 @@ public interface IAsyncPolicy : IsPolicy /// /// Executes the specified asynchronous action within the policy and returns the result. /// + /// The type of the result. /// The action to perform. /// Arbitrary data that is passed to the exception policy. /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. diff --git a/src/Polly/ISyncPolicy.Extensions.cs b/src/Polly/ISyncPolicy.Extensions.cs index 31334800c40..a5053e55b99 100644 --- a/src/Polly/ISyncPolicy.Extensions.cs +++ b/src/Polly/ISyncPolicy.Extensions.cs @@ -9,6 +9,7 @@ public static class ISyncPolicyExtensions /// Converts a non-generic into a generic for handling only executions returning . /// /// This method allows you to convert a non-generic into a generic for contexts such as variables or parameters which may explicitly require a generic . + /// The type of the result. /// The non-generic to convert to a generic . /// A generic version of the supplied non-generic . public static ISyncPolicy AsPolicy(this ISyncPolicy policy) => diff --git a/src/Polly/ISyncPolicy.cs b/src/Polly/ISyncPolicy.cs index 3fddc2d7902..e14f7f5f202 100644 --- a/src/Polly/ISyncPolicy.cs +++ b/src/Polly/ISyncPolicy.cs @@ -168,6 +168,7 @@ public interface ISyncPolicy : IsPolicy /// /// Executes the specified action within the policy and returns the captured result. /// + /// The type of the result. /// The action to perform. /// The captured result. PolicyResult ExecuteAndCapture(Func action); @@ -175,6 +176,7 @@ public interface ISyncPolicy : IsPolicy /// /// Executes the specified action within the policy and returns the captured result. /// + /// The type of the result. /// The action to perform. /// Arbitrary data that is passed to the exception policy. /// The captured result. @@ -184,6 +186,7 @@ public interface ISyncPolicy : IsPolicy /// /// Executes the specified action within the policy and returns the captured result. /// + /// The type of the result. /// The action to perform. /// Context data that is passed to the exception policy. /// The captured result. @@ -213,6 +216,7 @@ public interface ISyncPolicy : IsPolicy /// /// Executes the specified action within the policy and returns the captured result. /// + /// The type of the result. /// The action to perform. /// Context data that is passed to the exception policy. /// The cancellation token. diff --git a/src/Polly/NoOp/AsyncNoOpPolicy.cs b/src/Polly/NoOp/AsyncNoOpPolicy.cs index f75cddafd7e..68fdcb74976 100644 --- a/src/Polly/NoOp/AsyncNoOpPolicy.cs +++ b/src/Polly/NoOp/AsyncNoOpPolicy.cs @@ -21,6 +21,7 @@ protected override Task ImplementationAsync(Func /// A noop policy that can be applied to asynchronous delegates returning a value of type . /// +/// The type of the result. public class AsyncNoOpPolicy : AsyncPolicy, INoOpPolicy { internal AsyncNoOpPolicy() diff --git a/src/Polly/NoOp/INoOpPolicy.cs b/src/Polly/NoOp/INoOpPolicy.cs index 8e04c7372da..e5b32d3005b 100644 --- a/src/Polly/NoOp/INoOpPolicy.cs +++ b/src/Polly/NoOp/INoOpPolicy.cs @@ -12,6 +12,7 @@ public interface INoOpPolicy : IsPolicy /// /// Defines properties and methods common to all NoOp policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface INoOpPolicy : INoOpPolicy { } diff --git a/src/Polly/Policy.ExecuteOverloads.cs b/src/Polly/Policy.ExecuteOverloads.cs index 5576b7399b1..c4828d63f81 100644 --- a/src/Polly/Policy.ExecuteOverloads.cs +++ b/src/Polly/Policy.ExecuteOverloads.cs @@ -247,6 +247,7 @@ public PolicyResult ExecuteAndCapture(Action action, /// /// Executes the specified action within the policy and returns the captured result. /// + /// The type of the result. /// The action to perform. /// The captured result. [DebuggerStepThrough] @@ -256,6 +257,7 @@ public PolicyResult ExecuteAndCapture(Func action) => /// /// Executes the specified action within the policy and returns the captured result. /// + /// The type of the result. /// The action to perform. /// Arbitrary data that is passed to the exception policy. /// The captured result. @@ -267,6 +269,7 @@ public PolicyResult ExecuteAndCapture(Func a /// /// Executes the specified action within the policy and returns the captured result. /// + /// The type of the result. /// The action to perform. /// Context data that is passed to the exception policy. /// The captured result. @@ -301,6 +304,7 @@ public PolicyResult ExecuteAndCapture(Func /// Executes the specified action within the policy and returns the captured result. /// + /// The type of the result. /// The action to perform. /// Context data that is passed to the exception policy. /// The cancellation token. diff --git a/src/Polly/PolicyBase.cs b/src/Polly/PolicyBase.cs index 85f11886fde..a54a8f3db1b 100644 --- a/src/Polly/PolicyBase.cs +++ b/src/Polly/PolicyBase.cs @@ -49,6 +49,7 @@ protected PolicyBase(PolicyBuilder policyBuilder) /// /// Implements elements common to sync and async generic policies. /// +/// The type of the result. public abstract class PolicyBase : PolicyBase { /// diff --git a/src/Polly/PolicyResult.cs b/src/Polly/PolicyResult.cs index 9aafa7e44b2..7446035b312 100644 --- a/src/Polly/PolicyResult.cs +++ b/src/Polly/PolicyResult.cs @@ -59,6 +59,7 @@ public static PolicyResult Failure(Exception exception, ExceptionType exceptionT /// /// The captured result of executing a policy. /// +/// The type of the result. public class PolicyResult { internal PolicyResult(TResult result, OutcomeType outcome, Exception finalException, ExceptionType? exceptionType, Context context) diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index e128b592ed9..ef9bae12f9a 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -9,7 +9,7 @@ true $(NoWarn);IDE0011;S103;S3872;SA1402;SA1414;S3215 $(NoWarn);IDE1006;CA1062;S107;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 - $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;SA1618;CA1033 + $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1625;SA1623;SA1118 $(NoWarn);S3253;S3971;S6605;CA1724;CA1716;SA1108;CA1710;S4049;S3246 $(NoWarn);CA1805 diff --git a/src/Polly/RateLimit/AsyncRateLimitPolicy.cs b/src/Polly/RateLimit/AsyncRateLimitPolicy.cs index 86e8b0c2949..0acec910a53 100644 --- a/src/Polly/RateLimit/AsyncRateLimitPolicy.cs +++ b/src/Polly/RateLimit/AsyncRateLimitPolicy.cs @@ -22,6 +22,7 @@ protected override Task ImplementationAsync(Func /// A rate-limit policy that can be applied to asynchronous delegates returning a value of type . /// +/// The type of the result. public class AsyncRateLimitPolicy : AsyncPolicy, IRateLimitPolicy { private readonly IRateLimiter _rateLimiter; diff --git a/src/Polly/RateLimit/IRateLimitPolicy.cs b/src/Polly/RateLimit/IRateLimitPolicy.cs index 58e8b5041b3..d30534ef538 100644 --- a/src/Polly/RateLimit/IRateLimitPolicy.cs +++ b/src/Polly/RateLimit/IRateLimitPolicy.cs @@ -12,6 +12,7 @@ public interface IRateLimitPolicy : IsPolicy /// /// Defines properties and methods common to all RateLimit policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface IRateLimitPolicy : IRateLimitPolicy { } diff --git a/src/Polly/RateLimit/RateLimitPolicy.cs b/src/Polly/RateLimit/RateLimitPolicy.cs index d9cb2bc2066..07de422bfb2 100644 --- a/src/Polly/RateLimit/RateLimitPolicy.cs +++ b/src/Polly/RateLimit/RateLimitPolicy.cs @@ -21,6 +21,7 @@ protected override TResult Implementation(Func /// A rate-limit policy that can be applied to synchronous delegates returning a value of type . /// +/// The type of the result. public class RateLimitPolicy : Policy, IRateLimitPolicy { private readonly IRateLimiter _rateLimiter; diff --git a/src/Polly/Registry/IConcurrentPolicyRegistry.cs b/src/Polly/Registry/IConcurrentPolicyRegistry.cs index 7c2427ddfe1..4f8c30c44ff 100644 --- a/src/Polly/Registry/IConcurrentPolicyRegistry.cs +++ b/src/Polly/Registry/IConcurrentPolicyRegistry.cs @@ -45,6 +45,7 @@ bool TryUpdate(TKey key, TPolicy newPolicy, TPolicy comparisonPolicy) /// Adds a policy with the provided key and policy to the registry /// if the key does not already exist. /// + /// The type of Policy. /// The key of the policy to add. /// The function used to generate a policy for the key. /// The policy for the key. This will be either the existing policy for the key if the @@ -57,6 +58,7 @@ TPolicy GetOrAdd(TKey key, Func policyFactory) /// Adds a key/policy pair to the registry /// if the key does not already exist. /// + /// The type of Policy. /// The key of the policy to add. /// The value to be added, if the key does not already exist. /// The policy for the key. This will be either the existing policy for the key if the @@ -69,6 +71,7 @@ TPolicy GetOrAdd(TKey key, TPolicy policy) /// exist, or updates a key/policy pair in the registry if the key /// already exists. /// + /// The type of Policy. /// The key to be added or whose policy should be updated. /// The function used to generate a policy for an absent key. /// The function used to generate a new policy for an existing key @@ -83,6 +86,7 @@ TPolicy AddOrUpdate(TKey key, Func addPolicyFactory, Fun /// exist, or updates a key/policy pair in the registry if the key /// already exists. /// + /// The type of Policy. /// The key to be added or whose policy should be updated. /// The policy to be added for an absent key. /// The function used to generate a new policy for an existing key based on diff --git a/src/Polly/Registry/PolicyRegistry.cs b/src/Polly/Registry/PolicyRegistry.cs index 6e927b3336d..34169e35d22 100644 --- a/src/Polly/Registry/PolicyRegistry.cs +++ b/src/Polly/Registry/PolicyRegistry.cs @@ -181,6 +181,7 @@ public bool TryUpdate(string key, TPolicy newPolicy, TPolicy comparison /// Adds a policy with the provided key and policy to the registry /// if the key does not already exist. /// + /// The type of Policy. /// The key of the policy to add. /// The function used to generate a policy for the key. /// The policy for the key. This will be either the existing policy for the key if the @@ -198,6 +199,7 @@ public TPolicy GetOrAdd(string key, Func policyFactory /// Adds a key/policy pair to the registry /// if the key does not already exist. /// + /// The type of Policy. /// The key of the policy to add. /// the policy to be added, if the key does not already exist. /// The policy for the key. This will be either the existing policy for the key if the @@ -215,6 +217,7 @@ public TPolicy GetOrAdd(string key, TPolicy policy) /// exist, or updates a key/policy pair in the registry if the key /// already exists. /// + /// The type of Policy. /// The key to be added or whose policy should be updated. /// The function used to generate a policy for an absent key. /// The function used to generate a new policy for an existing key @@ -234,6 +237,7 @@ public TPolicy AddOrUpdate(string key, Func addPolicyF /// exist, or updates a key/policy pair in the registry if the key /// already exists. /// + /// The type of Policy. /// The key to be added or whose policy should be updated. /// The policy to be added for an absent key. /// The function used to generate a new policy for an existing key based on diff --git a/src/Polly/ResiliencePipelineConversionExtensions.cs b/src/Polly/ResiliencePipelineConversionExtensions.cs index b943c65805c..a02ef89c270 100644 --- a/src/Polly/ResiliencePipelineConversionExtensions.cs +++ b/src/Polly/ResiliencePipelineConversionExtensions.cs @@ -19,6 +19,7 @@ public static IAsyncPolicy AsAsyncPolicy(this ResiliencePipeline strategy) /// /// Converts a to an . /// + /// The type of the result. /// The strategy instance. /// An instance of . /// Thrown when is . @@ -38,6 +39,7 @@ public static ISyncPolicy AsSyncPolicy(this ResiliencePipeline strategy) /// Converts a to an . /// /// The strategy instance. + /// The type of the result. /// An instance of . /// Thrown when is . public static ISyncPolicy AsSyncPolicy(this ResiliencePipeline strategy) diff --git a/src/Polly/ResultPredicates.cs b/src/Polly/ResultPredicates.cs index ebe34ed8541..63b02ddec3a 100644 --- a/src/Polly/ResultPredicates.cs +++ b/src/Polly/ResultPredicates.cs @@ -3,6 +3,7 @@ /// /// A collection of predicates used to define whether a policy handles a given value. /// +/// The type of the result. public class ResultPredicates { private List> _predicates; diff --git a/src/Polly/Retry/AsyncRetryPolicy.cs b/src/Polly/Retry/AsyncRetryPolicy.cs index f7c2081f621..bd8b6b4b0f5 100644 --- a/src/Polly/Retry/AsyncRetryPolicy.cs +++ b/src/Polly/Retry/AsyncRetryPolicy.cs @@ -54,6 +54,7 @@ protected override Task ImplementationAsync( /// /// A retry policy that can be applied to asynchronous delegates returning a value of type . /// +/// The type of the result. public class AsyncRetryPolicy : AsyncPolicy, IRetryPolicy { private readonly Func, TimeSpan, int, Context, Task> _onRetryAsync; diff --git a/src/Polly/Retry/AsyncRetrySyntax.cs b/src/Polly/Retry/AsyncRetrySyntax.cs index ef247265b90..7cbb1d06070 100644 --- a/src/Polly/Retry/AsyncRetrySyntax.cs +++ b/src/Polly/Retry/AsyncRetrySyntax.cs @@ -318,7 +318,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func sleepDurationProvider) { @@ -335,7 +335,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -361,7 +361,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -387,7 +387,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -414,7 +414,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -439,7 +439,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -465,7 +465,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -498,7 +498,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -525,7 +525,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -550,7 +550,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -576,7 +576,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -600,7 +600,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -778,7 +778,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilde /// the current retry number (1 for first retry, 2 for second etc). /// /// The policy builder. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. /// Thrown when is . public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func sleepDurationProvider) @@ -797,7 +797,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder polic /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// /// The policy builder. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. /// Thrown when is . public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func sleepDurationProvider) diff --git a/src/Polly/Retry/AsyncRetryTResultSyntax.cs b/src/Polly/Retry/AsyncRetryTResultSyntax.cs index 8770a1420ea..5d5a8ba9227 100644 --- a/src/Polly/Retry/AsyncRetryTResultSyntax.cs +++ b/src/Polly/Retry/AsyncRetryTResultSyntax.cs @@ -8,6 +8,7 @@ public static class AsyncRetryTResultSyntax /// /// Builds an that will retry once. /// + /// The type of the result. /// The policy builder. /// The policy instance. public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder) => @@ -16,6 +17,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder /// Builds an that will retry times. /// + /// The type of the result. /// The policy builder. /// The retry count. /// The policy instance. @@ -30,6 +32,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder that will retry once /// calling on retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -43,6 +46,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder that will retry once /// calling on retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The action to call asynchronously on each retry. /// The policy instance. @@ -54,6 +58,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder that will retry times /// calling on each retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The retry count. /// The action to call on each retry. @@ -75,6 +80,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder that will retry times /// calling on each retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The retry count. /// The action to call asynchronously on each retry. @@ -93,6 +99,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder that will retry once /// calling on retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -104,6 +111,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder that will retry once /// calling on retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The action to call asynchronously on each retry. /// The policy instance. @@ -115,6 +123,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder that will retry times /// calling on each retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The retry count. /// The action to call on each retry. @@ -136,6 +145,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder that will retry times /// calling on each retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The retry count. /// The action to call asynchronously on each retry. @@ -158,6 +168,7 @@ public static AsyncRetryPolicy RetryAsync(this PolicyBuilder /// Builds an that will retry indefinitely until the action succeeds. /// + /// The type of the result. /// The policy builder. /// The policy instance. public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder) @@ -171,6 +182,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// Builds an that will retry indefinitely /// calling on each retry with the handled exception or result. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -190,6 +202,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// Builds an that will retry indefinitely /// calling on each retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -209,6 +222,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// Builds an that will retry indefinitely /// calling on each retry with the handled exception or result. /// + /// The type of the result. /// The policy builder. /// The action to call asynchronously on each retry. /// The policy instance. @@ -225,6 +239,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// Builds an that will retry indefinitely /// calling on each retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The action to call asynchronously on each retry. /// The policy instance. @@ -241,6 +256,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// Builds an that will retry indefinitely /// calling on each retry with the handled exception or result and context data. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -260,6 +276,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// Builds an that will retry indefinitely /// calling on each retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -279,6 +296,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// Builds an that will retry indefinitely /// calling on each retry with the handled exception or result and context data. /// + /// The type of the result. /// The policy builder. /// The action to call asynchronously on each retry. /// The policy instance. @@ -297,6 +315,7 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// Builds an that will retry indefinitely /// calling on each retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The action to call asynchronously on each retry. /// The policy instance. @@ -316,9 +335,10 @@ public static AsyncRetryPolicy RetryForeverAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func sleepDurationProvider) { @@ -333,9 +353,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -360,9 +381,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -386,9 +408,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -413,9 +436,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -437,9 +461,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -463,9 +488,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -496,9 +522,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -523,9 +550,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -547,9 +575,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -573,9 +602,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -598,9 +628,10 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc), result of previous execution, and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call asynchronously on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -627,6 +658,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The policy instance. @@ -643,6 +675,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// calling on each retry with the handled exception or result and the current sleep duration. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call on each retry. @@ -666,6 +699,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// calling on each retry with the handled exception or result and the current sleep duration. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call asynchronously on each retry. @@ -687,6 +721,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// calling on each retry with the handled exception or result, the current sleep duration and context data. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call on each retry. @@ -710,6 +745,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// calling on each retry with the handled exception or result, the current sleep duration and context data. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call asynchronously on each retry. @@ -731,6 +767,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// calling on each retry with the handled exception or result, the current sleep duration, retry count, and context data. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call on each retry. @@ -754,6 +791,7 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// calling on each retry with the handled exception or result, the current sleep duration, retry count, and context data. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call asynchronously on each retry. @@ -777,8 +815,9 @@ public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBu /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. /// Thrown when is . public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func sleepDurationProvider) @@ -796,8 +835,9 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. /// Thrown when is . public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func sleepDurationProvider) @@ -816,6 +856,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -840,6 +881,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -864,6 +906,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call asynchronously on each retry. @@ -888,6 +931,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call asynchronously on each retry. @@ -912,6 +956,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -936,6 +981,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -960,6 +1006,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call asynchronously on each retry. @@ -982,6 +1029,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call asynchronously on each retry. @@ -1004,6 +1052,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc), previous execution result and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call asynchronously on each retry. @@ -1029,6 +1078,7 @@ public static AsyncRetryPolicy WaitAndRetryForeverAsync(this P /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc), previous execution result and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call asynchronously on each retry. diff --git a/src/Polly/Retry/IRetryPolicy.cs b/src/Polly/Retry/IRetryPolicy.cs index 7dc3a45e523..0e938d039c4 100644 --- a/src/Polly/Retry/IRetryPolicy.cs +++ b/src/Polly/Retry/IRetryPolicy.cs @@ -10,6 +10,7 @@ public interface IRetryPolicy : IsPolicy /// /// Defines properties and methods common to all Retry policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface IRetryPolicy : IRetryPolicy { } diff --git a/src/Polly/Retry/RetryPolicy.cs b/src/Polly/Retry/RetryPolicy.cs index 06042672875..8662c5869bf 100644 --- a/src/Polly/Retry/RetryPolicy.cs +++ b/src/Polly/Retry/RetryPolicy.cs @@ -47,6 +47,7 @@ protected override TResult Implementation(Func /// A retry policy that can be applied to synchronous delegates returning a value of type . /// +/// The type of the result. public class RetryPolicy : Policy, IRetryPolicy { private readonly Action, TimeSpan, int, Context> _onRetry; diff --git a/src/Polly/Retry/RetrySyntax.cs b/src/Polly/Retry/RetrySyntax.cs index c4dd558437a..8a371b9aa41 100644 --- a/src/Polly/Retry/RetrySyntax.cs +++ b/src/Polly/Retry/RetrySyntax.cs @@ -178,7 +178,7 @@ public static RetryPolicy RetryForever(this PolicyBuilder policyBuilder, Action< /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int retryCount, Func sleepDurationProvider) { @@ -195,7 +195,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int ret /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -219,7 +219,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int ret /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -243,7 +243,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int ret /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -274,7 +274,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int ret /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int retryCount, Func sleepDurationProvider) { @@ -291,7 +291,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int ret /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -315,7 +315,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int ret /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -338,7 +338,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int ret /// /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -438,7 +438,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, IEnumer /// the current retry number (1 for first retry, 2 for second etc). /// /// The policy builder. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. /// Thrown when is . public static RetryPolicy WaitAndRetryForever(this PolicyBuilder policyBuilder, Func sleepDurationProvider) @@ -457,7 +457,7 @@ public static RetryPolicy WaitAndRetryForever(this PolicyBuilder policyBuilder, /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// /// The policy builder. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. /// Thrown when is . public static RetryPolicy WaitAndRetryForever(this PolicyBuilder policyBuilder, Func sleepDurationProvider) diff --git a/src/Polly/Retry/RetryTResultSyntax.cs b/src/Polly/Retry/RetryTResultSyntax.cs index c04d9dde0ff..3c1fbc30be5 100644 --- a/src/Polly/Retry/RetryTResultSyntax.cs +++ b/src/Polly/Retry/RetryTResultSyntax.cs @@ -8,6 +8,7 @@ public static class RetryTResultSyntax /// /// Builds a that will retry once. /// + /// The type of the result. /// The policy builder. /// The policy instance. public static RetryPolicy Retry(this PolicyBuilder policyBuilder) => @@ -16,6 +17,7 @@ public static RetryPolicy Retry(this PolicyBuilder po /// /// Builds a that will retry times. /// + /// The type of the result. /// The policy builder. /// The retry count. /// The policy instance. @@ -30,6 +32,7 @@ public static RetryPolicy Retry(this PolicyBuilder po /// Builds a that will retry once /// calling on retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -41,6 +44,7 @@ public static RetryPolicy Retry(this PolicyBuilder po /// Builds a that will retry times /// calling on each retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The retry count. /// The action to call on each retry. @@ -61,6 +65,7 @@ public static RetryPolicy Retry(this PolicyBuilder po /// Builds a that will retry once /// calling on retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -72,6 +77,7 @@ public static RetryPolicy Retry(this PolicyBuilder po /// Builds a that will retry times /// calling on each retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The retry count. /// The action to call on each retry. @@ -94,6 +100,7 @@ public static RetryPolicy Retry(this PolicyBuilder po /// /// Builds a that will retry indefinitely until the action succeeds. /// + /// The type of the result. /// The policy builder. /// The policy instance. public static RetryPolicy RetryForever(this PolicyBuilder policyBuilder) @@ -107,6 +114,7 @@ public static RetryPolicy RetryForever(this PolicyBuilder that will retry indefinitely /// calling on each retry with the handled exception or result. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -123,6 +131,7 @@ public static RetryPolicy RetryForever(this PolicyBuilder that will retry indefinitely /// calling on each retry with the handled exception or result and retry count. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -139,6 +148,7 @@ public static RetryPolicy RetryForever(this PolicyBuilder that will retry indefinitely /// calling on each retry with the handled exception or result and context data. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -157,6 +167,7 @@ public static RetryPolicy RetryForever(this PolicyBuilder that will retry indefinitely /// calling on each retry with the handled exception or result, retry count and context data. /// + /// The type of the result. /// The policy builder. /// The action to call on each retry. /// The policy instance. @@ -176,9 +187,10 @@ public static RetryPolicy RetryForever(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int retryCount, Func sleepDurationProvider) { @@ -193,9 +205,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -217,9 +230,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -241,9 +255,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -272,9 +287,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int retryCount, Func sleepDurationProvider) { @@ -289,9 +305,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -313,9 +330,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -331,9 +349,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc), previous execution result and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int retryCount, Func, Context, TimeSpan> sleepDurationProvider) { @@ -348,9 +367,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc), previous execution result and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -372,9 +392,10 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc), previous execution result and execution context. /// + /// The type of the result. /// The policy builder. /// The retry count. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The action to call on each retry. /// The policy instance. /// retryCount;Value must be greater than or equal to zero. @@ -399,6 +420,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder that will wait and retry as many times as there are provided /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The policy instance. @@ -414,6 +436,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder on each retry with the handled exception or result and the current sleep duration. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call on each retry. @@ -432,6 +455,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder on each retry with the handled exception or result, current sleep duration and context data. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call on each retry. @@ -450,6 +474,7 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder on each retry with the handled exception or result, current sleep duration, retry count and context data. /// On each retry, the duration to wait is the current item. /// + /// The type of the result. /// The policy builder. /// The sleep durations to wait for on each retry. /// The action to call on each retry. @@ -473,8 +498,9 @@ public static RetryPolicy WaitAndRetry(this PolicyBuilder with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. /// Thrown when is . public static RetryPolicy WaitAndRetryForever(this PolicyBuilder policyBuilder, Func sleepDurationProvider) @@ -492,8 +518,9 @@ public static RetryPolicy WaitAndRetryForever(this PolicyBuild /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. - /// The function that provides the duration to wait for for a particular retry attempt. + /// The function that provides the duration to wait for a particular retry attempt. /// The policy instance. /// Thrown when is . public static RetryPolicy WaitAndRetryForever(this PolicyBuilder policyBuilder, Func sleepDurationProvider) @@ -512,6 +539,7 @@ public static RetryPolicy WaitAndRetryForever(this PolicyBuild /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -536,6 +564,7 @@ public static RetryPolicy WaitAndRetryForever(this PolicyBuild /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc). /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -560,6 +589,7 @@ public static RetryPolicy WaitAndRetryForever(this PolicyBuild /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -582,6 +612,7 @@ public static RetryPolicy WaitAndRetryForever(this PolicyBuild /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc) and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -604,6 +635,7 @@ public static RetryPolicy WaitAndRetryForever(this PolicyBuild /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc), previous execution result and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. @@ -629,6 +661,7 @@ public static RetryPolicy WaitAndRetryForever(this PolicyBuild /// On each retry, the duration to wait is calculated by calling with /// the current retry number (1 for first retry, 2 for second etc), previous execution result and execution context. /// + /// The type of the result. /// The policy builder. /// A function providing the duration to wait before retrying. /// The action to call on each retry. diff --git a/src/Polly/Timeout/AsyncTimeoutTResultSyntax.cs b/src/Polly/Timeout/AsyncTimeoutTResultSyntax.cs index 7e73cdfe099..ff1986a2ad6 100644 --- a/src/Polly/Timeout/AsyncTimeoutTResultSyntax.cs +++ b/src/Polly/Timeout/AsyncTimeoutTResultSyntax.cs @@ -5,6 +5,7 @@ public partial class Policy /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The number of seconds after which to timeout. /// seconds;Value must be greater than zero. /// The policy instance. @@ -19,6 +20,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds) /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The number of seconds after which to timeout. /// The timeout strategy. /// seconds;Value must be greater than zero. @@ -34,6 +36,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, Tim /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The number of seconds after which to timeout. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -50,6 +53,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, Fun /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The number of seconds after which to timeout. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -67,6 +71,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, Fun /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The number of seconds after which to timeout. /// The timeout strategy. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. @@ -84,6 +89,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, Tim /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The number of seconds after which to timeout. /// The timeout strategy. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . @@ -102,6 +108,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, Tim /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The timeout. /// The policy instance. /// timeout;Value must be a positive TimeSpan (or Timeout.InfiniteTimeSpan to indicate no timeout). @@ -116,6 +123,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(TimeSpan timeout /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The timeout. /// The timeout strategy. /// The policy instance. @@ -131,6 +139,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(TimeSpan timeout /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The timeout. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -149,6 +158,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(TimeSpan timeout /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The timeout. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -168,6 +178,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(TimeSpan timeout /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The timeout. /// The timeout strategy. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. @@ -185,6 +196,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(TimeSpan timeout /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The timeout. /// The timeout strategy. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . @@ -202,6 +214,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(TimeSpan timeout /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// Thrown when is . /// The policy instance. @@ -217,6 +230,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func t /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// The timeout strategy. /// Thrown when is . @@ -233,6 +247,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func t /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -250,6 +265,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func t /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -267,6 +283,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func t /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// The timeout strategy. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. @@ -285,6 +302,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func t /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// The timeout strategy. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . @@ -303,6 +321,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func t /// /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// Thrown when is . /// The policy instance. @@ -315,6 +334,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// The timeout strategy. /// Thrown when is . @@ -328,6 +348,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -340,6 +361,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -352,6 +374,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// The timeout strategy. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. @@ -370,6 +393,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(Func /// Builds an that will wait asynchronously for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// A function to provide the timeout for this execution. /// The timeout strategy. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . diff --git a/src/Polly/Timeout/ITimeoutPolicy.cs b/src/Polly/Timeout/ITimeoutPolicy.cs index 8c4ab380281..df2b44a4fca 100644 --- a/src/Polly/Timeout/ITimeoutPolicy.cs +++ b/src/Polly/Timeout/ITimeoutPolicy.cs @@ -10,6 +10,7 @@ public interface ITimeoutPolicy : IsPolicy /// /// Defines properties and methods common to all Timeout policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface ITimeoutPolicy : ITimeoutPolicy { } diff --git a/src/Polly/Timeout/TimeoutPolicy.cs b/src/Polly/Timeout/TimeoutPolicy.cs index 0f9390ed66f..179b37301db 100644 --- a/src/Polly/Timeout/TimeoutPolicy.cs +++ b/src/Polly/Timeout/TimeoutPolicy.cs @@ -34,6 +34,7 @@ protected override TResult Implementation(Func /// A timeout policy which can be applied to delegates returning a value of type . /// +/// The type of the result. public class TimeoutPolicy : Policy, ITimeoutPolicy { private readonly TimeoutStrategy _timeoutStrategy; diff --git a/src/Polly/Timeout/TimeoutTResultSyntax.cs b/src/Polly/Timeout/TimeoutTResultSyntax.cs index 3ab38addce5..cab88febc5e 100644 --- a/src/Polly/Timeout/TimeoutTResultSyntax.cs +++ b/src/Polly/Timeout/TimeoutTResultSyntax.cs @@ -36,6 +36,7 @@ public static TimeoutPolicy Timeout(int seconds, TimeoutStrate /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// The number of seconds after which to timeout. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -51,6 +52,7 @@ public static TimeoutPolicy Timeout(int seconds, Action /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// The number of seconds after which to timeout. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -105,6 +107,7 @@ public static TimeoutPolicy Timeout(int seconds, TimeoutStrate /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The type of the result. /// The timeout. /// The policy instance. /// timeout;Value must be a positive TimeSpan (or Timeout.InfiniteTimeSpan to indicate no timeout). @@ -135,6 +138,7 @@ public static TimeoutPolicy Timeout(TimeSpan timeout, TimeoutS /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// The timeout. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -150,6 +154,7 @@ public static TimeoutPolicy Timeout(TimeSpan timeout, Action /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// The timeout. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -199,6 +204,7 @@ public static TimeoutPolicy Timeout(TimeSpan timeout, TimeoutS /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// A function to provide the timeout for this execution. /// Thrown when is . /// The policy instance. @@ -231,6 +237,7 @@ public static TimeoutPolicy Timeout(Func timeoutProv /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// A function to provide the timeout for this execution. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -248,6 +255,7 @@ public static TimeoutPolicy Timeout(Func timeoutProv /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// A function to provide the timeout for this execution. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -303,6 +311,7 @@ public static TimeoutPolicy Timeout(Func timeoutProv /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// A function to provide the timeout for this execution. /// Thrown when is . /// The policy instance. @@ -329,6 +338,7 @@ public static TimeoutPolicy Timeout(Func ti /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// A function to provide the timeout for this execution. /// An action to call on timeout, passing the execution context, the timeout applied, and a capturing the abandoned, timed-out action. /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. @@ -341,6 +351,7 @@ public static TimeoutPolicy Timeout(Func ti /// /// Builds a that will wait for a delegate to complete for a specified period of time. A will be thrown if the delegate does not complete within the configured timeout. /// + /// The return type of delegates which may be executed through the policy. /// A function to provide the timeout for this execution. /// An action to call on timeout, passing the execution context, the timeout applied, the capturing the abandoned, timed-out action, and the captured . /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. diff --git a/src/Polly/Wrap/AsyncPolicyWrapSyntax.cs b/src/Polly/Wrap/AsyncPolicyWrapSyntax.cs index 0bb2cc19367..cbc0cdd6868 100644 --- a/src/Polly/Wrap/AsyncPolicyWrapSyntax.cs +++ b/src/Polly/Wrap/AsyncPolicyWrapSyntax.cs @@ -21,6 +21,7 @@ public static AsyncPolicyWrap WrapAsync(this IAsyncPolicy outerPolicy, IAsyncPol /// /// Wraps the specified outer policy round the inner policy. /// + /// The type of the result. /// The outer policy. /// The inner policy. /// A instance representing the combined wrap. @@ -34,6 +35,7 @@ public static AsyncPolicyWrap WrapAsync(this IAsyncPolicy oute /// /// Wraps the specified outer policy round the inner policy. /// + /// The type of the result. /// The outer policy. /// The inner policy. /// A instance representing the combined wrap. @@ -47,6 +49,7 @@ public static AsyncPolicyWrap WrapAsync(this IAsyncPolicy /// Wraps the specified outer policy round the inner policy. /// + /// The type of the result. /// The outer policy. /// The inner policy. /// A instance representing the combined wrap. diff --git a/src/Polly/Wrap/IPolicyWrap.cs b/src/Polly/Wrap/IPolicyWrap.cs index abea62a2ecd..b8535ea78bd 100644 --- a/src/Polly/Wrap/IPolicyWrap.cs +++ b/src/Polly/Wrap/IPolicyWrap.cs @@ -19,6 +19,7 @@ public interface IPolicyWrap : IsPolicy /// /// Defines properties and methods common to all PolicyWrap policies generic-typed for executions returning results of type . /// +/// The type of the result. public interface IPolicyWrap : IPolicyWrap { } diff --git a/src/Polly/Wrap/PolicyWrapSyntax.cs b/src/Polly/Wrap/PolicyWrapSyntax.cs index a55c9d6c6d5..e44fea20e36 100644 --- a/src/Polly/Wrap/PolicyWrapSyntax.cs +++ b/src/Polly/Wrap/PolicyWrapSyntax.cs @@ -21,6 +21,7 @@ public static PolicyWrap Wrap(this ISyncPolicy outerPolicy, ISyncPolicy innerPol /// /// Wraps the specified outer policy round the inner policy. /// + /// The type of the result. /// The outer policy. /// The inner policy. /// A instance representing the combined wrap. @@ -34,6 +35,7 @@ public static PolicyWrap Wrap(this ISyncPolicy outerPolicy, IS /// /// Wraps the specified outer policy round the inner policy. /// + /// The type of the result. /// The outer policy. /// The inner policy. /// A instance representing the combined wrap. @@ -47,6 +49,7 @@ public static PolicyWrap Wrap(this ISyncPolicy outerP /// /// Wraps the specified outer policy round the inner policy. /// + /// The type of the result. /// The outer policy. /// The inner policy. /// A instance representing the combined wrap. From f32222b70dec918d3d05e5cba3f698c696fdcd71 Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Thu, 25 Apr 2024 23:38:22 +0300 Subject: [PATCH 02/19] Consolidate typeparam text --- src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs | 2 +- .../CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs | 2 +- src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs b/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs index 16740fe6472..bc19455523e 100644 --- a/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs +++ b/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs @@ -16,7 +16,7 @@ public static class AdvancedCircuitBreakerTResultSyntax /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// - /// The type of the result. + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. diff --git a/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs b/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs index 930902fac64..67afe0c6fff 100644 --- a/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs +++ b/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs @@ -87,7 +87,7 @@ public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync; if no exception or handled result is encountered, the circuit will reset. /// /// - /// The type of the result. + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure). /// The duration of the timeslice over which failure ratios are assessed. diff --git a/src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs b/src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs index 18b424e0ebc..885777e73d5 100644 --- a/src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs +++ b/src/Polly/CircuitBreaker/AsyncCircuitBreakerTResultSyntax.cs @@ -113,7 +113,7 @@ public static AsyncCircuitBreakerPolicy CircuitBreakerAsync(th /// again for another ; if no exception or handled result is encountered, the circuit will reset. /// /// - /// The type of the result. + /// The return type of delegates which may be executed through the policy. /// The policy builder. /// The number of exceptions or handled results that are allowed before opening the circuit. /// The duration the circuit will stay open before resetting. From e013fa4861c0be80d876316638290488b98f8d70 Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Fri, 26 Apr 2024 00:05:24 +0300 Subject: [PATCH 03/19] Enable S6605 --- src/Polly/Polly.csproj | 2 +- src/Polly/ResultPredicates.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index ef9bae12f9a..6326a634f1e 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -11,7 +11,7 @@ $(NoWarn);IDE1006;CA1062;S107;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1625;SA1623;SA1118 - $(NoWarn);S3253;S3971;S6605;CA1724;CA1716;SA1108;CA1710;S4049;S3246 + $(NoWarn);S3253;S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 $(NoWarn);CA1805 diff --git a/src/Polly/ResultPredicates.cs b/src/Polly/ResultPredicates.cs index 63b02ddec3a..093c139d65a 100644 --- a/src/Polly/ResultPredicates.cs +++ b/src/Polly/ResultPredicates.cs @@ -24,7 +24,7 @@ public bool AnyMatch(TResult result) if (_predicates == null) return false; - return _predicates.Any(predicate => predicate(result)); + return _predicates.Exists(predicate => predicate(result)); } /// From f21b7836740ffaff08f4851f66f1579dfc78b24e Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Fri, 26 Apr 2024 00:11:04 +0300 Subject: [PATCH 04/19] Disable S3253 --- src/Polly/Polly.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 6326a634f1e..d79fe8d113f 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -11,7 +11,7 @@ $(NoWarn);IDE1006;CA1062;S107;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1625;SA1623;SA1118 - $(NoWarn);S3253;S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 + $(NoWarn);S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 $(NoWarn);CA1805 From ee0f007750d9fda0c47a10d82446ad19ac806534 Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Sun, 28 Apr 2024 20:02:10 +0300 Subject: [PATCH 05/19] Fix SA1625 --- src/Polly/Bulkhead/AsyncBulkheadSyntax.cs | 1 - src/Polly/Bulkhead/BulkheadSyntax.cs | 2 +- src/Polly/Polly.csproj | 2 +- src/Polly/Timeout/AsyncTimeoutSyntax.cs | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Polly/Bulkhead/AsyncBulkheadSyntax.cs b/src/Polly/Bulkhead/AsyncBulkheadSyntax.cs index 80cfc1459a9..5513b57fce7 100644 --- a/src/Polly/Bulkhead/AsyncBulkheadSyntax.cs +++ b/src/Polly/Bulkhead/AsyncBulkheadSyntax.cs @@ -24,7 +24,6 @@ public static AsyncBulkheadPolicy BulkheadAsync(int maxParallelization) /// The policy instance. /// maxParallelization;Value must be greater than zero. /// Thrown when is . - /// The policy instance. public static AsyncBulkheadPolicy BulkheadAsync(int maxParallelization, Func onBulkheadRejectedAsync) => BulkheadAsync(maxParallelization, 0, onBulkheadRejectedAsync); diff --git a/src/Polly/Bulkhead/BulkheadSyntax.cs b/src/Polly/Bulkhead/BulkheadSyntax.cs index c841d9d8ba4..d0b985100db 100644 --- a/src/Polly/Bulkhead/BulkheadSyntax.cs +++ b/src/Polly/Bulkhead/BulkheadSyntax.cs @@ -52,7 +52,7 @@ public static BulkheadPolicy Bulkhead(int maxParallelization, int maxQueuingActi /// An action to call, if the bulkhead rejects execution due to oversubscription. /// The policy instance. /// maxParallelization;Value must be greater than zero. - /// maxParallelization;Value must be greater than zero. + /// maxParallelization;Value must be greater than or equal to zero. /// Thrown when is . public static BulkheadPolicy Bulkhead(int maxParallelization, int maxQueuingActions, Action onBulkheadRejected) { diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index ef9bae12f9a..fc8497f8d0f 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -10,7 +10,7 @@ $(NoWarn);IDE0011;S103;S3872;SA1402;SA1414;S3215 $(NoWarn);IDE1006;CA1062;S107;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 - $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1625;SA1623;SA1118 + $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1623;SA1118 $(NoWarn);S3253;S3971;S6605;CA1724;CA1716;SA1108;CA1710;S4049;S3246 $(NoWarn);CA1805 diff --git a/src/Polly/Timeout/AsyncTimeoutSyntax.cs b/src/Polly/Timeout/AsyncTimeoutSyntax.cs index c268414569c..57386a4b9d3 100644 --- a/src/Polly/Timeout/AsyncTimeoutSyntax.cs +++ b/src/Polly/Timeout/AsyncTimeoutSyntax.cs @@ -78,7 +78,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, FuncThe Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. /// The policy instance. /// seconds;Value must be greater than zero. - /// seconds;Value must be greater than zero. + /// seconds;Value must not be null. public static AsyncTimeoutPolicy TimeoutAsync(int seconds, TimeoutStrategy timeoutStrategy, Func onTimeoutAsync) { TimeoutValidator.ValidateSecondsTimeout(seconds); @@ -95,7 +95,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, TimeoutStrategy timeo /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. /// The policy instance. /// seconds;Value must be greater than zero. - /// seconds;Value must be greater than zero. + /// seconds;Value must not be null. public static AsyncTimeoutPolicy TimeoutAsync(int seconds, TimeoutStrategy timeoutStrategy, Func onTimeoutAsync) { if (seconds <= 0) From 62ecd4a94ec77ef2e31cf91102a8f34c309f9b29 Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:44:02 +0300 Subject: [PATCH 06/19] Fix S103 --- eng/Analyzers.targets | 1 + eng/analyzers/SonarLint.xml | 14 ++++++++++++++ src/Polly/Fallback/AsyncFallbackPolicy.cs | 5 ++++- src/Polly/Fallback/FallbackPolicy.cs | 5 ++++- src/Polly/Polly.csproj | 2 +- src/Polly/Timeout/TimeoutEngine.cs | 8 +++++++- 6 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 eng/analyzers/SonarLint.xml diff --git a/eng/Analyzers.targets b/eng/Analyzers.targets index a3a37e46713..01c0a55faf3 100644 --- a/eng/Analyzers.targets +++ b/eng/Analyzers.targets @@ -4,6 +4,7 @@ + diff --git a/eng/analyzers/SonarLint.xml b/eng/analyzers/SonarLint.xml new file mode 100644 index 00000000000..9386ae4545c --- /dev/null +++ b/eng/analyzers/SonarLint.xml @@ -0,0 +1,14 @@ + + + + + S103 + + + maximumLineLength + 500 + + + + + diff --git a/src/Polly/Fallback/AsyncFallbackPolicy.cs b/src/Polly/Fallback/AsyncFallbackPolicy.cs index 6d9ef1d5ff0..5c42f6dc59a 100644 --- a/src/Polly/Fallback/AsyncFallbackPolicy.cs +++ b/src/Polly/Fallback/AsyncFallbackPolicy.cs @@ -45,7 +45,10 @@ protected override Task ImplementationAsync( /// protected override Task ImplementationAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext) => - throw new InvalidOperationException($"You have executed the generic .Execute<{nameof(TResult)}> method on a non-generic {nameof(FallbackPolicy)}. A non-generic {nameof(FallbackPolicy)} only defines a fallback action which returns void; it can never return a substitute {nameof(TResult)} value. To use {nameof(FallbackPolicy)} to provide fallback {nameof(TResult)} values you must define a generic fallback policy {nameof(FallbackPolicy)}<{nameof(TResult)}>. For example, define the policy as Policy<{nameof(TResult)}>.Handle.Fallback<{nameof(TResult)}>(/* some {nameof(TResult)} value or Func<..., {nameof(TResult)}> */);"); + throw new InvalidOperationException($"You have executed the generic .Execute<{nameof(TResult)}> method on a non-generic {nameof(FallbackPolicy)}. " + + $"A non-generic {nameof(FallbackPolicy)} only defines a fallback action which returns void; it can never return a substitute {nameof(TResult)} value. " + + $"To use {nameof(FallbackPolicy)} to provide fallback {nameof(TResult)} values you must define a generic fallback policy {nameof(FallbackPolicy)}<{nameof(TResult)}>. " + + $"For example, define the policy as Policy<{nameof(TResult)}>.Handle.Fallback<{nameof(TResult)}>(/* some {nameof(TResult)} value or Func<..., {nameof(TResult)}> */);"); } /// diff --git a/src/Polly/Fallback/FallbackPolicy.cs b/src/Polly/Fallback/FallbackPolicy.cs index 3deeaeea9f0..808f535263e 100644 --- a/src/Polly/Fallback/FallbackPolicy.cs +++ b/src/Polly/Fallback/FallbackPolicy.cs @@ -42,7 +42,10 @@ protected override void Implementation(Action action /// protected override TResult Implementation(Func action, Context context, CancellationToken cancellationToken) => - throw new InvalidOperationException($"You have executed the generic .Execute<{nameof(TResult)}> method on a non-generic {nameof(FallbackPolicy)}. A non-generic {nameof(FallbackPolicy)} only defines a fallback action which returns void; it can never return a substitute {nameof(TResult)} value. To use {nameof(FallbackPolicy)} to provide fallback {nameof(TResult)} values you must define a generic fallback policy {nameof(FallbackPolicy)}<{nameof(TResult)}>. For example, define the policy as Policy<{nameof(TResult)}>.Handle.Fallback<{nameof(TResult)}>(/* some {nameof(TResult)} value or Func<..., {nameof(TResult)}> */);"); + throw new InvalidOperationException($"You have executed the generic .Execute<{nameof(TResult)}> method on a non-generic {nameof(FallbackPolicy)}. " + + $"A non-generic {nameof(FallbackPolicy)} only defines a fallback action which returns void; it can never return a substitute {nameof(TResult)} value. " + + $"To use {nameof(FallbackPolicy)} to provide fallback {nameof(TResult)} values you must define a generic fallback policy {nameof(FallbackPolicy)}<{nameof(TResult)}>. " + + $"For example, define the policy as Policy<{nameof(TResult)}>.Handle.Fallback<{nameof(TResult)}>(/* some {nameof(TResult)} value or Func<..., {nameof(TResult)}> */);"); } /// diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index ef9bae12f9a..8a99fde9d2c 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -7,7 +7,7 @@ Library 70 true - $(NoWarn);IDE0011;S103;S3872;SA1402;SA1414;S3215 + $(NoWarn);IDE0011;S3872;SA1402;SA1414;S3215 $(NoWarn);IDE1006;CA1062;S107;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1625;SA1623;SA1118 diff --git a/src/Polly/Timeout/TimeoutEngine.cs b/src/Polly/Timeout/TimeoutEngine.cs index 150adf32c22..5bed28927e7 100644 --- a/src/Polly/Timeout/TimeoutEngine.cs +++ b/src/Polly/Timeout/TimeoutEngine.cs @@ -38,7 +38,13 @@ internal static TResult Implementation( combinedToken); // cancellation token here only allows Task.Run() to not begin the passed delegate at all, if cancellation occurs prior to invoking the delegate. try { - actionTask.Wait(timeoutCancellationTokenSource.Token); // cancellation token here cancels the Wait() and causes it to throw, but does not cancel actionTask. We use only timeoutCancellationTokenSource.Token here, not combinedToken. If we allowed the user's cancellation token to cancel the Wait(), in this pessimistic scenario where the user delegate may not observe that cancellation, that would create a no-longer-observed task. That task could in turn later fault before completing, risking an UnobservedTaskException. + /* + * Cancellation token here cancels the Wait() and causes it to throw, but does not cancel actionTask. + * We use only timeoutCancellationTokenSource.Token here, not combinedToken. + * If we allowed the user's cancellation token to cancel the Wait(), in this pessimistic scenario where the user delegate may not observe that cancellation, that would create a no-longer-observed task. + * That task could in turn later fault before completing, risking an UnobservedTaskException. + */ + actionTask.Wait(timeoutCancellationTokenSource.Token); } catch (AggregateException ex) when (ex.InnerExceptions.Count == 1) // Issue #270. Unwrap extra AggregateException caused by the way pessimistic timeout policy for synchronous executions is necessarily constructed. { From aad9e034de1c4d6e4cba78ab3706b2e9e0e534c9 Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:23:15 +0300 Subject: [PATCH 07/19] Add new line --- src/Polly/Polly.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index e08ef4bd84c..5740e426f50 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -36,4 +36,4 @@ - \ No newline at end of file + From c4c77eedbc0641764190999e4097fad6691f3a6b Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:24:07 +0300 Subject: [PATCH 08/19] Revert auto formatting --- src/Polly/Polly.csproj | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 5740e426f50..4381cd4fc71 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -14,18 +14,20 @@ $(NoWarn);S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 $(NoWarn);CA1805 - + $(NoWarn);RS0037; - Polly is a .NET resilience and transient-fault-handling library that allows + + Polly is a .NET resilience and transient-fault-handling library that allows developers to express resilience and transient fault handling policies such as Retry, Circuit - Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. - Polly Exception Handling Resilience Transient Fault Policy Circuit Breaker - CircuitBreaker Retry Wait Cache Cache-aside Bulkhead Fallback Timeout Throttle + Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. + + + Polly Exception Handling Resilience Transient Fault Policy Circuit Breaker + CircuitBreaker Retry Wait Cache Cache-aside Bulkhead Fallback Timeout Throttle + From f8eecf3705a9f48096fdbfe54b67bee101c5a7da Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:24:39 +0300 Subject: [PATCH 09/19] Revert formatted files --- src/Polly/Polly.csproj | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 4381cd4fc71..ab26de48fac 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -19,15 +19,8 @@ - - Polly is a .NET resilience and transient-fault-handling library that allows - developers to express resilience and transient fault handling policies such as Retry, Circuit - Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. - - - Polly Exception Handling Resilience Transient Fault Policy Circuit Breaker - CircuitBreaker Retry Wait Cache Cache-aside Bulkhead Fallback Timeout Throttle - + Polly is a .NET resilience and transient-fault-handling library that allows developers to express resilience and transient fault handling policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. + Polly Exception Handling Resilience Transient Fault Policy Circuit Breaker CircuitBreaker Retry Wait Cache Cache-aside Bulkhead Fallback Timeout Throttle From fdb1b2707e80fa9f90f8ca6fe84d9b430f052c57 Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:15:04 +0300 Subject: [PATCH 10/19] Fix ArgumentNullException doc reference to onTimeoutAsync param --- src/Polly/Timeout/AsyncTimeoutSyntax.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Polly/Timeout/AsyncTimeoutSyntax.cs b/src/Polly/Timeout/AsyncTimeoutSyntax.cs index 57386a4b9d3..3b6c462dfab 100644 --- a/src/Polly/Timeout/AsyncTimeoutSyntax.cs +++ b/src/Polly/Timeout/AsyncTimeoutSyntax.cs @@ -78,7 +78,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, FuncThe Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. /// The policy instance. /// seconds;Value must be greater than zero. - /// seconds;Value must not be null. + /// onTimeoutAsync;Value must not be null. public static AsyncTimeoutPolicy TimeoutAsync(int seconds, TimeoutStrategy timeoutStrategy, Func onTimeoutAsync) { TimeoutValidator.ValidateSecondsTimeout(seconds); @@ -95,7 +95,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, TimeoutStrategy timeo /// The Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. /// The policy instance. /// seconds;Value must be greater than zero. - /// seconds;Value must not be null. + /// Thrown when is . public static AsyncTimeoutPolicy TimeoutAsync(int seconds, TimeoutStrategy timeoutStrategy, Func onTimeoutAsync) { if (seconds <= 0) From 4c34715bfbb4d01a8378796de62472eff1e53487 Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:15:16 +0300 Subject: [PATCH 11/19] Fix ArgumentOutOfRangeException doc reference to maxQueuingActions --- src/Polly/Bulkhead/BulkheadSyntax.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Polly/Bulkhead/BulkheadSyntax.cs b/src/Polly/Bulkhead/BulkheadSyntax.cs index d0b985100db..91e89d45eec 100644 --- a/src/Polly/Bulkhead/BulkheadSyntax.cs +++ b/src/Polly/Bulkhead/BulkheadSyntax.cs @@ -52,7 +52,7 @@ public static BulkheadPolicy Bulkhead(int maxParallelization, int maxQueuingActi /// An action to call, if the bulkhead rejects execution due to oversubscription. /// The policy instance. /// maxParallelization;Value must be greater than zero. - /// maxParallelization;Value must be greater than or equal to zero. + /// maxQueuingActions;Value must be greater than or equal to zero. /// Thrown when is . public static BulkheadPolicy Bulkhead(int maxParallelization, int maxQueuingActions, Action onBulkheadRejected) { From f8351532e29dfb7c51a417d97fec4ea5103316ae Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:21:32 +0300 Subject: [PATCH 12/19] Consolidate exception docs in AsyncTimeoutSyntax --- src/Polly/Timeout/AsyncTimeoutSyntax.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Polly/Timeout/AsyncTimeoutSyntax.cs b/src/Polly/Timeout/AsyncTimeoutSyntax.cs index 0dc978ead96..e1fcac99129 100644 --- a/src/Polly/Timeout/AsyncTimeoutSyntax.cs +++ b/src/Polly/Timeout/AsyncTimeoutSyntax.cs @@ -85,7 +85,7 @@ public static AsyncTimeoutPolicy TimeoutAsync(int seconds, FuncThe Task parameter will be null if the executed action responded cooperatively to cancellation before the policy timed it out. /// The policy instance. /// seconds;Value must be greater than zero. - /// onTimeoutAsync;Value must not be null. + /// Thrown when is . public static AsyncTimeoutPolicy TimeoutAsync(int seconds, TimeoutStrategy timeoutStrategy, Func onTimeoutAsync) { TimeoutValidator.ValidateSecondsTimeout(seconds); From 0154cbf8ca5bcffce52cb21279fbc665a2caa24d Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:31:03 +0300 Subject: [PATCH 13/19] Fix S107 --- Polly.sln | 12 ++++++++++++ eng/analyzers/SonarLint.xml | 9 +++++++++ src/Polly/Polly.csproj | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Polly.sln b/Polly.sln index 7bb28d106d3..92a68a4c3c7 100644 --- a/Polly.sln +++ b/Polly.sln @@ -60,6 +60,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Snippets", "src\Snippets\Sn EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.AotTest", "test\Polly.AotTest\Polly.AotTest.csproj", "{84091007-CFA5-4852-AC41-0171DF039C4E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "analyzers", "analyzers", "{4CB0EFF4-D867-4FA4-809D-C19F2F2A7C71}" + ProjectSection(SolutionItems) = preProject + eng\analyzers\BannedSymbols.txt = eng\analyzers\BannedSymbols.txt + eng\analyzers\Benchmark.globalconfig = eng\analyzers\Benchmark.globalconfig + eng\analyzers\Library.globalconfig = eng\analyzers\Library.globalconfig + eng\analyzers\SonarLint.xml = eng\analyzers\SonarLint.xml + eng\analyzers\Stylecop.globalconfig = eng\analyzers\Stylecop.globalconfig + eng\analyzers\Stylecop.json = eng\analyzers\Stylecop.json + eng\analyzers\Test.globalconfig = eng\analyzers\Test.globalconfig + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -147,6 +158,7 @@ Global {D333B5CE-982D-4C11-BDAF-4217AA02306E} = {A6CC41B9-E0B9-44F8-916B-3E4A78DA3BFB} {D812B941-79B0-4E1E-BB70-4FAE345B5234} = {B7BF406B-B06F-4025-83E6-7219C53196A6} {84091007-CFA5-4852-AC41-0171DF039C4E} = {A6CC41B9-E0B9-44F8-916B-3E4A78DA3BFB} + {4CB0EFF4-D867-4FA4-809D-C19F2F2A7C71} = {04E3C7C5-31F7-4CD6-8BEC-C1032527D231} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2E5D54CD-770A-4345-B585-1848FC2EA6F4} diff --git a/eng/analyzers/SonarLint.xml b/eng/analyzers/SonarLint.xml index 9386ae4545c..e033103b0ba 100644 --- a/eng/analyzers/SonarLint.xml +++ b/eng/analyzers/SonarLint.xml @@ -10,5 +10,14 @@ + + S107 + + + max + 12 + + + diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 58e363a6f20..4ac2a74391d 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -8,7 +8,7 @@ 70 true $(NoWarn);S3872;SA1402;SA1414;S3215 - $(NoWarn);IDE1006;CA1062;S107;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 + $(NoWarn);IDE1006;CA1062;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1623;SA1118 $(NoWarn);S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 From 7d5c0ada72a3229d919e7403ededc61bca95345f Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Tue, 30 Apr 2024 21:01:45 +0300 Subject: [PATCH 14/19] Fix CA1000 --- .editorconfig | 2 +- src/Polly/Polly.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 083be16435d..753c839b682 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,7 +23,7 @@ tab_width = 2 # Put any C# specific settings here dotnet_code_quality.CA1062.null_check_validation_methods = NotNull - +dotnet_code_quality.CA1000.api_surface = private, internal # S2094 // Classes should not be empty dotnet_diagnostic.S2094.severity = suggestion diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 4ac2a74391d..907369b574a 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -8,7 +8,7 @@ 70 true $(NoWarn);S3872;SA1402;SA1414;S3215 - $(NoWarn);IDE1006;CA1062;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 + $(NoWarn);IDE1006;CA1062;CA1068;S4039;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1623;SA1118 $(NoWarn);S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 From 60d5060d1f3269bcab3865f2eb6b2e4c90ed135d Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Tue, 30 Apr 2024 21:02:37 +0300 Subject: [PATCH 15/19] Add new line --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index 753c839b682..101d9bc2501 100644 --- a/.editorconfig +++ b/.editorconfig @@ -24,6 +24,7 @@ tab_width = 2 # Put any C# specific settings here dotnet_code_quality.CA1062.null_check_validation_methods = NotNull dotnet_code_quality.CA1000.api_surface = private, internal + # S2094 // Classes should not be empty dotnet_diagnostic.S2094.severity = suggestion From ec5314e02d765d92feef1fde29b56279272bc44c Mon Sep 17 00:00:00 2001 From: iamdmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Tue, 30 Apr 2024 21:20:03 +0300 Subject: [PATCH 16/19] Fix S4023 --- .editorconfig | 3 +++ src/Polly/Polly.csproj | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 083be16435d..cda948939a1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -27,6 +27,9 @@ dotnet_code_quality.CA1062.null_check_validation_methods = NotNull # S2094 // Classes should not be empty dotnet_diagnostic.S2094.severity = suggestion +# S4023 // Interfaces should not be empty +dotnet_diagnostic.S4023.severity = suggestion + # Prefer method-like constructs to have a block body csharp_style_expression_bodied_methods = true:error csharp_style_expression_bodied_constructors = true:error diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 4ac2a74391d..6ce58c1b5d5 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -10,7 +10,7 @@ $(NoWarn);S3872;SA1402;SA1414;S3215 $(NoWarn);IDE1006;CA1062;CA1068;S4039;CA1000;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 - $(NoWarn);S4023;CA1010;S3442;CA1064;SA1649;SA1623;SA1118 + $(NoWarn);CA1010;S3442;CA1064;SA1649;SA1623;SA1118 $(NoWarn);S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 $(NoWarn);CA1805 From 950e7ef701e092ba0a4b0480494176dc8937e369 Mon Sep 17 00:00:00 2001 From: Dmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:29:09 +0300 Subject: [PATCH 17/19] Fix SA1649 (#9) --- .../{IAsyncPolicy.Extensions.cs => IAsyncPolicyExtensions.cs} | 0 .../{ISyncPolicy.Extensions.cs => ISyncPolicyExtensions.cs} | 0 src/Polly/Polly.csproj | 2 +- ...cPolicyWrapSyntax.cs => IAsyncPolicyPolicyWrapExtensions.cs} | 0 .../{PolicyWrapSyntax.cs => ISyncPolicyPolicyWrapExtensions.cs} | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename src/Polly/{IAsyncPolicy.Extensions.cs => IAsyncPolicyExtensions.cs} (100%) rename src/Polly/{ISyncPolicy.Extensions.cs => ISyncPolicyExtensions.cs} (100%) rename src/Polly/Wrap/{AsyncPolicyWrapSyntax.cs => IAsyncPolicyPolicyWrapExtensions.cs} (100%) rename src/Polly/Wrap/{PolicyWrapSyntax.cs => ISyncPolicyPolicyWrapExtensions.cs} (100%) diff --git a/src/Polly/IAsyncPolicy.Extensions.cs b/src/Polly/IAsyncPolicyExtensions.cs similarity index 100% rename from src/Polly/IAsyncPolicy.Extensions.cs rename to src/Polly/IAsyncPolicyExtensions.cs diff --git a/src/Polly/ISyncPolicy.Extensions.cs b/src/Polly/ISyncPolicyExtensions.cs similarity index 100% rename from src/Polly/ISyncPolicy.Extensions.cs rename to src/Polly/ISyncPolicyExtensions.cs diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index a5967de5476..39d6e600784 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -10,7 +10,7 @@ $(NoWarn);S3872;SA1402;SA1414;S3215 $(NoWarn);IDE1006;CA1062;CA1068;S4039;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 - $(NoWarn);CA1010;S3442;CA1064;SA1649;SA1623;SA1118 + $(NoWarn);CA1010;S3442;CA1064;SA1623;SA1118 $(NoWarn);S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 $(NoWarn);CA1805 diff --git a/src/Polly/Wrap/AsyncPolicyWrapSyntax.cs b/src/Polly/Wrap/IAsyncPolicyPolicyWrapExtensions.cs similarity index 100% rename from src/Polly/Wrap/AsyncPolicyWrapSyntax.cs rename to src/Polly/Wrap/IAsyncPolicyPolicyWrapExtensions.cs diff --git a/src/Polly/Wrap/PolicyWrapSyntax.cs b/src/Polly/Wrap/ISyncPolicyPolicyWrapExtensions.cs similarity index 100% rename from src/Polly/Wrap/PolicyWrapSyntax.cs rename to src/Polly/Wrap/ISyncPolicyPolicyWrapExtensions.cs From 0ddf2ccdcb4b78666e41cec9c6f7263d36e8ef63 Mon Sep 17 00:00:00 2001 From: Dmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:47:20 +0300 Subject: [PATCH 18/19] Fix SA1402 (#10) * Fix SA1402 * Update .editorconfig * Update .editorconfig --- .editorconfig | 3 +++ src/Polly/Polly.csproj | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index f95dd30b06a..c73c66ab9ba 100644 --- a/.editorconfig +++ b/.editorconfig @@ -28,6 +28,9 @@ dotnet_code_quality.CA1000.api_surface = private, internal # S2094 // Classes should not be empty dotnet_diagnostic.S2094.severity = suggestion +# SA1402 // File may only contain a single type +dotnet_diagnostic.SA1402.severity = none + # S4023 // Interfaces should not be empty dotnet_diagnostic.S4023.severity = suggestion diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 39d6e600784..46f3c441665 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -7,7 +7,7 @@ Library 70 true - $(NoWarn);S3872;SA1402;SA1414;S3215 + $(NoWarn);S3872;SA1414;S3215 $(NoWarn);IDE1006;CA1062;CA1068;S4039;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 $(NoWarn);CA1010;S3442;CA1064;SA1623;SA1118 From a6acc1a50eb128d592e3a7092c6b5d50b4afee0e Mon Sep 17 00:00:00 2001 From: Dmitrij <3024338+iamdmitrij@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:53:54 +0300 Subject: [PATCH 19/19] Fix S3442 (#8) * Fix S3442 * Fix linting error --- src/Polly/AsyncPolicy.TResult.cs | 2 +- src/Polly/AsyncPolicy.cs | 2 +- src/Polly/Policy.TResult.cs | 2 +- src/Polly/Policy.cs | 2 +- src/Polly/PolicyBase.cs | 4 ++-- src/Polly/Polly.csproj | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Polly/AsyncPolicy.TResult.cs b/src/Polly/AsyncPolicy.TResult.cs index 55704841faf..f22ef592b32 100644 --- a/src/Polly/AsyncPolicy.TResult.cs +++ b/src/Polly/AsyncPolicy.TResult.cs @@ -12,7 +12,7 @@ public abstract partial class AsyncPolicy : PolicyBase /// /// Predicates indicating which exceptions the policy should handle. /// Predicates indicating which results the policy should handle. - internal AsyncPolicy( + private protected AsyncPolicy( ExceptionPredicates exceptionPredicates, ResultPredicates resultPredicates) : base(exceptionPredicates, resultPredicates) diff --git a/src/Polly/AsyncPolicy.cs b/src/Polly/AsyncPolicy.cs index 3829723fdf2..2626c3b8485 100644 --- a/src/Polly/AsyncPolicy.cs +++ b/src/Polly/AsyncPolicy.cs @@ -10,7 +10,7 @@ public abstract partial class AsyncPolicy /// Initializes a new instance of the class. /// /// Predicates indicating which exceptions the policy should handle. - internal AsyncPolicy(ExceptionPredicates exceptionPredicates) + private protected AsyncPolicy(ExceptionPredicates exceptionPredicates) : base(exceptionPredicates) { } diff --git a/src/Polly/Policy.TResult.cs b/src/Polly/Policy.TResult.cs index 5337c86e90c..d19674c15c8 100644 --- a/src/Polly/Policy.TResult.cs +++ b/src/Polly/Policy.TResult.cs @@ -12,7 +12,7 @@ public abstract partial class Policy : PolicyBase /// /// Predicates indicating which exceptions the policy should handle. /// Predicates indicating which results the policy should handle. - internal Policy(ExceptionPredicates exceptionPredicates, ResultPredicates resultPredicates) + private protected Policy(ExceptionPredicates exceptionPredicates, ResultPredicates resultPredicates) : base(exceptionPredicates, resultPredicates) { } diff --git a/src/Polly/Policy.cs b/src/Polly/Policy.cs index 6fa155e6616..b11c5a651aa 100644 --- a/src/Polly/Policy.cs +++ b/src/Polly/Policy.cs @@ -10,7 +10,7 @@ public abstract partial class Policy : PolicyBase /// Initializes a new instance of the class. /// /// Predicates indicating which exceptions the policy should handle. - internal Policy(ExceptionPredicates exceptionPredicates) + private protected Policy(ExceptionPredicates exceptionPredicates) : base(exceptionPredicates) { } diff --git a/src/Polly/PolicyBase.cs b/src/Polly/PolicyBase.cs index a54a8f3db1b..9451c44b918 100644 --- a/src/Polly/PolicyBase.cs +++ b/src/Polly/PolicyBase.cs @@ -33,7 +33,7 @@ internal static ExceptionType GetExceptionType(ExceptionPredicates exceptionPred /// Initializes a new instance of the class. /// /// Predicates indicating which exceptions the policy should handle. - internal PolicyBase(ExceptionPredicates exceptionPredicates) => + private protected PolicyBase(ExceptionPredicates exceptionPredicates) => ExceptionPredicates = exceptionPredicates ?? ExceptionPredicates.None; /// @@ -62,7 +62,7 @@ public abstract class PolicyBase : PolicyBase /// /// Predicates indicating which exceptions the policy should handle. /// Predicates indicating which results the policy should handle. - internal PolicyBase( + private protected PolicyBase( ExceptionPredicates exceptionPredicates, ResultPredicates resultPredicates) : base(exceptionPredicates) => diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 46f3c441665..09707cbbe14 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -10,7 +10,7 @@ $(NoWarn);S3872;SA1414;S3215 $(NoWarn);IDE1006;CA1062;CA1068;S4039;CA1063;CA1031;CA1051 $(NoWarn);CA2211;S2223;CA1032;CA1815;CA1816;S4457;SA1615;CA1033 - $(NoWarn);CA1010;S3442;CA1064;SA1623;SA1118 + $(NoWarn);CA1010;CA1064;SA1623;SA1118 $(NoWarn);S3971;CA1724;CA1716;SA1108;CA1710;S4049;S3246 $(NoWarn);CA1805