diff --git a/src/Polly/AsyncPolicy.ContextAndKeys.cs b/src/Polly/AsyncPolicy.ContextAndKeys.cs
index 09fe154bc7b..ec0e813c149 100644
--- a/src/Polly/AsyncPolicy.ContextAndKeys.cs
+++ b/src/Polly/AsyncPolicy.ContextAndKeys.cs
@@ -9,7 +9,8 @@ public abstract partial class AsyncPolicy
/// The unique, used-definable key to assign to this instance.
public AsyncPolicy WithPolicyKey(string policyKey)
{
- if (policyKeyInternal != null) throw PolicyKeyMustBeImmutableException(nameof(policyKey));
+ if (policyKeyInternal != null)
+ throw PolicyKeyMustBeImmutableException(nameof(policyKey));
policyKeyInternal = policyKey;
return this;
@@ -22,7 +23,8 @@ public AsyncPolicy WithPolicyKey(string policyKey)
/// The unique, used-definable key to assign to this instance.
IAsyncPolicy IAsyncPolicy.WithPolicyKey(string policyKey)
{
- if (policyKeyInternal != null) throw PolicyKeyMustBeImmutableException(nameof(policyKey));
+ if (policyKeyInternal != null)
+ throw PolicyKeyMustBeImmutableException(nameof(policyKey));
policyKeyInternal = policyKey;
return this;
@@ -38,7 +40,8 @@ public abstract partial class AsyncPolicy
/// The unique, used-definable key to assign to this instance.
public AsyncPolicy WithPolicyKey(string policyKey)
{
- if (policyKeyInternal != null) throw PolicyKeyMustBeImmutableException(nameof(policyKey));
+ if (policyKeyInternal != null)
+ throw PolicyKeyMustBeImmutableException(nameof(policyKey));
policyKeyInternal = policyKey;
return this;
@@ -51,7 +54,8 @@ public AsyncPolicy WithPolicyKey(string policyKey)
/// The unique, used-definable key to assign to this instance.
IAsyncPolicy IAsyncPolicy.WithPolicyKey(string policyKey)
{
- if (policyKeyInternal != null) throw PolicyKeyMustBeImmutableException(nameof(policyKey));
+ if (policyKeyInternal != null)
+ throw PolicyKeyMustBeImmutableException(nameof(policyKey));
policyKeyInternal = policyKey;
return this;
diff --git a/src/Polly/AsyncPolicy.ExecuteOverloads.cs b/src/Polly/AsyncPolicy.ExecuteOverloads.cs
index 0d35960c437..2040b08e4b7 100644
--- a/src/Polly/AsyncPolicy.ExecuteOverloads.cs
+++ b/src/Polly/AsyncPolicy.ExecuteOverloads.cs
@@ -93,7 +93,8 @@ public Task ExecuteAsync(Func action, IDiction
[DebuggerStepThrough]
public async Task ExecuteAsync(Func action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
- if (context == null) throw new ArgumentNullException(nameof(context));
+ if (context == null)
+ throw new ArgumentNullException(nameof(context));
SetPolicyContext(context, out string priorPolicyWrapKey, out string priorPolicyKey);
@@ -213,7 +214,8 @@ public Task ExecuteAsync(Func ExecuteAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
- if (context == null) throw new ArgumentNullException(nameof(context));
+ if (context == null)
+ throw new ArgumentNullException(nameof(context));
SetPolicyContext(context, out string priorPolicyWrapKey, out string priorPolicyKey);
@@ -329,7 +331,8 @@ public Task ExecuteAndCaptureAsync(Func ExecuteAndCaptureAsync(Func action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
- if (context == null) throw new ArgumentNullException(nameof(context));
+ if (context == null)
+ throw new ArgumentNullException(nameof(context));
try
{
@@ -453,7 +456,8 @@ public Task> ExecuteAndCaptureAsync(Func> ExecuteAndCaptureAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
- if (context == null) throw new ArgumentNullException(nameof(context));
+ if (context == null)
+ throw new ArgumentNullException(nameof(context));
try
{
diff --git a/src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs b/src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs
index 1daa607943e..fedc85c45a4 100644
--- a/src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs
+++ b/src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs
@@ -102,7 +102,8 @@ public Task ExecuteAsync(Func
[DebuggerStepThrough]
public async Task ExecuteAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
- if (context == null) throw new ArgumentNullException(nameof(context));
+ if (context == null)
+ throw new ArgumentNullException(nameof(context));
SetPolicyContext(context, out string priorPolicyWrapKey, out string priorPolicyKey);
@@ -220,7 +221,8 @@ public Task> ExecuteAndCaptureAsync(Func> ExecuteAndCaptureAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
- if (context == null) throw new ArgumentNullException(nameof(context));
+ if (context == null)
+ throw new ArgumentNullException(nameof(context));
try
{
diff --git a/src/Polly/Bulkhead/AsyncBulkheadEngine.cs b/src/Polly/Bulkhead/AsyncBulkheadEngine.cs
index 1476fcb5879..7640dc5216d 100644
--- a/src/Polly/Bulkhead/AsyncBulkheadEngine.cs
+++ b/src/Polly/Bulkhead/AsyncBulkheadEngine.cs
@@ -3,7 +3,7 @@ namespace Polly.Bulkhead;
internal static class AsyncBulkheadEngine
{
- internal static async Task ImplementationAsync(
+ internal static async Task ImplementationAsync(
Func> action,
Context context,
Func onBulkheadRejectedAsync,
diff --git a/src/Polly/Bulkhead/AsyncBulkheadSyntax.cs b/src/Polly/Bulkhead/AsyncBulkheadSyntax.cs
index 36f904f5380..9e01a11930b 100644
--- a/src/Polly/Bulkhead/AsyncBulkheadSyntax.cs
+++ b/src/Polly/Bulkhead/AsyncBulkheadSyntax.cs
@@ -59,9 +59,12 @@ public static AsyncBulkheadPolicy BulkheadAsync(
int maxQueuingActions,
Func onBulkheadRejectedAsync)
{
- if (maxParallelization <= 0) throw new ArgumentOutOfRangeException(nameof(maxParallelization), "Value must be greater than zero.");
- if (maxQueuingActions < 0) throw new ArgumentOutOfRangeException(nameof(maxQueuingActions), "Value must be greater than or equal to zero.");
- if (onBulkheadRejectedAsync == null) throw new ArgumentNullException(nameof(onBulkheadRejectedAsync));
+ if (maxParallelization <= 0)
+ throw new ArgumentOutOfRangeException(nameof(maxParallelization), "Value must be greater than zero.");
+ if (maxQueuingActions < 0)
+ throw new ArgumentOutOfRangeException(nameof(maxQueuingActions), "Value must be greater than or equal to zero.");
+ if (onBulkheadRejectedAsync == null)
+ throw new ArgumentNullException(nameof(onBulkheadRejectedAsync));
return new AsyncBulkheadPolicy(
maxParallelization,
diff --git a/src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs b/src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs
index f3335538c10..77990236f53 100644
--- a/src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs
+++ b/src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs
@@ -56,9 +56,12 @@ public static AsyncBulkheadPolicy BulkheadAsync(int maxParalle
/// onBulkheadRejectedAsync
public static AsyncBulkheadPolicy BulkheadAsync(int maxParallelization, int maxQueuingActions, Func onBulkheadRejectedAsync)
{
- if (maxParallelization <= 0) throw new ArgumentOutOfRangeException(nameof(maxParallelization), "Value must be greater than zero.");
- if (maxQueuingActions < 0) throw new ArgumentOutOfRangeException(nameof(maxQueuingActions), "Value must be greater than or equal to zero.");
- if (onBulkheadRejectedAsync == null) throw new ArgumentNullException(nameof(onBulkheadRejectedAsync));
+ if (maxParallelization <= 0)
+ throw new ArgumentOutOfRangeException(nameof(maxParallelization), "Value must be greater than zero.");
+ if (maxQueuingActions < 0)
+ throw new ArgumentOutOfRangeException(nameof(maxQueuingActions), "Value must be greater than or equal to zero.");
+ if (onBulkheadRejectedAsync == null)
+ throw new ArgumentNullException(nameof(onBulkheadRejectedAsync));
return new AsyncBulkheadPolicy(
maxParallelization,
diff --git a/src/Polly/Bulkhead/BulkheadSyntax.cs b/src/Polly/Bulkhead/BulkheadSyntax.cs
index ed928e105ae..2b15e6c757b 100644
--- a/src/Polly/Bulkhead/BulkheadSyntax.cs
+++ b/src/Polly/Bulkhead/BulkheadSyntax.cs
@@ -56,9 +56,12 @@ public static BulkheadPolicy Bulkhead(int maxParallelization, int maxQueuingActi
/// onBulkheadRejected
public static BulkheadPolicy Bulkhead(int maxParallelization, int maxQueuingActions, Action onBulkheadRejected)
{
- if (maxParallelization <= 0) throw new ArgumentOutOfRangeException(nameof(maxParallelization), "Value must be greater than zero.");
- if (maxQueuingActions < 0) throw new ArgumentOutOfRangeException(nameof(maxQueuingActions), "Value must be greater than or equal to zero.");
- if (onBulkheadRejected == null) throw new ArgumentNullException(nameof(onBulkheadRejected));
+ if (maxParallelization <= 0)
+ throw new ArgumentOutOfRangeException(nameof(maxParallelization), "Value must be greater than zero.");
+ if (maxQueuingActions < 0)
+ throw new ArgumentOutOfRangeException(nameof(maxQueuingActions), "Value must be greater than or equal to zero.");
+ if (onBulkheadRejected == null)
+ throw new ArgumentNullException(nameof(onBulkheadRejected));
return new BulkheadPolicy(
maxParallelization,
diff --git a/src/Polly/Bulkhead/BulkheadTResultSyntax.cs b/src/Polly/Bulkhead/BulkheadTResultSyntax.cs
index a8e43ae824a..55445998e36 100644
--- a/src/Polly/Bulkhead/BulkheadTResultSyntax.cs
+++ b/src/Polly/Bulkhead/BulkheadTResultSyntax.cs
@@ -56,9 +56,12 @@ public static BulkheadPolicy Bulkhead(int maxParallelization,
/// onBulkheadRejected
public static BulkheadPolicy Bulkhead(int maxParallelization, int maxQueuingActions, Action onBulkheadRejected)
{
- if (maxParallelization <= 0) throw new ArgumentOutOfRangeException(nameof(maxParallelization), "Value must be greater than zero.");
- if (maxQueuingActions < 0) throw new ArgumentOutOfRangeException(nameof(maxQueuingActions), "Value must be greater than or equal to zero.");
- if (onBulkheadRejected == null) throw new ArgumentNullException(nameof(onBulkheadRejected));
+ if (maxParallelization <= 0)
+ throw new ArgumentOutOfRangeException(nameof(maxParallelization), "Value must be greater than zero.");
+ if (maxQueuingActions < 0)
+ throw new ArgumentOutOfRangeException(nameof(maxQueuingActions), "Value must be greater than or equal to zero.");
+ if (onBulkheadRejected == null)
+ throw new ArgumentNullException(nameof(onBulkheadRejected));
return new BulkheadPolicy(
maxParallelization,
diff --git a/src/Polly/Caching/AsyncCachePolicy.cs b/src/Polly/Caching/AsyncCachePolicy.cs
index e2b6445c921..a4e0b925388 100644
--- a/src/Polly/Caching/AsyncCachePolicy.cs
+++ b/src/Polly/Caching/AsyncCachePolicy.cs
@@ -42,9 +42,7 @@ protected override Task ImplementationAsync(
Func action,
Context context,
CancellationToken cancellationToken,
- bool continueOnCapturedContext) =>
- // Pass-through/NOOP policy action, for void-returning executions through the cache policy.
- action(context, cancellationToken);
+ bool continueOnCapturedContext) => action(context, cancellationToken); // Pass-through/NOOP policy action, for void-returning executions through the cache policy.
///
[DebuggerStepThrough]
diff --git a/src/Polly/Caching/AsyncCacheSyntax.cs b/src/Polly/Caching/AsyncCacheSyntax.cs
index 7353ad46939..b7a5702d117 100644
--- a/src/Polly/Caching/AsyncCacheSyntax.cs
+++ b/src/Polly/Caching/AsyncCacheSyntax.cs
@@ -64,9 +64,12 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, Tim
/// cacheKeyStrategy
public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, ICacheKeyStrategy cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
- if (ttlStrategy == null) throw new ArgumentNullException(nameof(ttlStrategy));
- if (cacheKeyStrategy == null) throw new ArgumentNullException(nameof(cacheKeyStrategy));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
+ if (ttlStrategy == null)
+ throw new ArgumentNullException(nameof(ttlStrategy));
+ if (cacheKeyStrategy == null)
+ throw new ArgumentNullException(nameof(cacheKeyStrategy));
Action emptyDelegate = (_, _) => { };
@@ -105,9 +108,12 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, Tim
/// cacheKeyStrategy
public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, Func cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
- if (ttlStrategy == null) throw new ArgumentNullException(nameof(ttlStrategy));
- if (cacheKeyStrategy == null) throw new ArgumentNullException(nameof(cacheKeyStrategy));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
+ if (ttlStrategy == null)
+ throw new ArgumentNullException(nameof(ttlStrategy));
+ if (cacheKeyStrategy == null)
+ throw new ArgumentNullException(nameof(cacheKeyStrategy));
Action emptyDelegate = (_, _) => { };
@@ -296,13 +302,19 @@ public static AsyncCachePolicy CacheAsync(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
- if (ttlStrategy == null) throw new ArgumentNullException(nameof(ttlStrategy));
- if (cacheKeyStrategy == null) throw new ArgumentNullException(nameof(cacheKeyStrategy));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
+ if (ttlStrategy == null)
+ throw new ArgumentNullException(nameof(ttlStrategy));
+ if (cacheKeyStrategy == null)
+ throw new ArgumentNullException(nameof(cacheKeyStrategy));
- if (onCacheGet == null) throw new ArgumentNullException(nameof(onCacheGet));
- if (onCacheMiss == null) throw new ArgumentNullException(nameof(onCacheMiss));
- if (onCachePut == null) throw new ArgumentNullException(nameof(onCachePut));
+ if (onCacheGet == null)
+ throw new ArgumentNullException(nameof(onCacheGet));
+ if (onCacheMiss == null)
+ throw new ArgumentNullException(nameof(onCacheMiss));
+ if (onCachePut == null)
+ throw new ArgumentNullException(nameof(onCachePut));
return new AsyncCachePolicy(cacheProvider, ttlStrategy, cacheKeyStrategy, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
diff --git a/src/Polly/Caching/AsyncCacheTResultSyntax.cs b/src/Polly/Caching/AsyncCacheTResultSyntax.cs
index da92d36c82a..6a7752186bc 100644
--- a/src/Polly/Caching/AsyncCacheTResultSyntax.cs
+++ b/src/Polly/Caching/AsyncCacheTResultSyntax.cs
@@ -16,7 +16,8 @@ public partial class Policy
/// cacheProvider
public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, TimeSpan ttl, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), new RelativeTtl(ttl), DefaultCacheKeyStrategy.Instance.GetCacheKey, onCacheError);
}
@@ -35,7 +36,8 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider
/// ttlStrategy
public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), ttlStrategy, DefaultCacheKeyStrategy.Instance.GetCacheKey, onCacheError);
}
@@ -55,7 +57,8 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider
/// cacheKeyStrategy
public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, TimeSpan ttl, ICacheKeyStrategy cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), new RelativeTtl(ttl), cacheKeyStrategy.GetCacheKey, onCacheError);
}
@@ -76,7 +79,8 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider
/// cacheKeyStrategy
public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, ICacheKeyStrategy cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), ttlStrategy, cacheKeyStrategy.GetCacheKey, onCacheError);
}
@@ -96,7 +100,8 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider
/// cacheKeyStrategy
public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, TimeSpan ttl, Func cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), new RelativeTtl(ttl), cacheKeyStrategy, onCacheError);
}
@@ -117,7 +122,8 @@ public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider
/// cacheKeyStrategy
public static AsyncCachePolicy CacheAsync(IAsyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, Func cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), ttlStrategy, cacheKeyStrategy, onCacheError);
}
@@ -149,7 +155,8 @@ public static AsyncCachePolicy CacheAsync(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), new RelativeTtl(ttl), DefaultCacheKeyStrategy.Instance.GetCacheKey, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -182,7 +189,8 @@ public static AsyncCachePolicy CacheAsync(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), ttlStrategy, DefaultCacheKeyStrategy.Instance.GetCacheKey, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -217,7 +225,8 @@ public static AsyncCachePolicy CacheAsync(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), new RelativeTtl(ttl), cacheKeyStrategy.GetCacheKey, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -253,7 +262,8 @@ public static AsyncCachePolicy CacheAsync(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), ttlStrategy, cacheKeyStrategy.GetCacheKey, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -288,7 +298,8 @@ public static AsyncCachePolicy CacheAsync(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), new RelativeTtl(ttl), cacheKeyStrategy, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -324,7 +335,8 @@ public static AsyncCachePolicy CacheAsync(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return CacheAsync(cacheProvider.AsyncFor(), ttlStrategy, cacheKeyStrategy, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -767,13 +779,19 @@ public static AsyncCachePolicy CacheAsync(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
- if (ttlStrategy == null) throw new ArgumentNullException(nameof(ttlStrategy));
- if (cacheKeyStrategy == null) throw new ArgumentNullException(nameof(cacheKeyStrategy));
-
- if (onCacheGet == null) throw new ArgumentNullException(nameof(onCacheGet));
- if (onCacheMiss == null) throw new ArgumentNullException(nameof(onCacheMiss));
- if (onCachePut == null) throw new ArgumentNullException(nameof(onCachePut));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
+ if (ttlStrategy == null)
+ throw new ArgumentNullException(nameof(ttlStrategy));
+ if (cacheKeyStrategy == null)
+ throw new ArgumentNullException(nameof(cacheKeyStrategy));
+
+ if (onCacheGet == null)
+ throw new ArgumentNullException(nameof(onCacheGet));
+ if (onCacheMiss == null)
+ throw new ArgumentNullException(nameof(onCacheMiss));
+ if (onCachePut == null)
+ throw new ArgumentNullException(nameof(onCachePut));
return new AsyncCachePolicy(cacheProvider, ttlStrategy, cacheKeyStrategy, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
diff --git a/src/Polly/Caching/CacheSyntax.cs b/src/Polly/Caching/CacheSyntax.cs
index d104ed2d98a..68fe93eecc0 100644
--- a/src/Polly/Caching/CacheSyntax.cs
+++ b/src/Polly/Caching/CacheSyntax.cs
@@ -64,9 +64,12 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvider, TimeSpan ttl,
/// cacheKeyStrategy
public static CachePolicy Cache(ISyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, ICacheKeyStrategy cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
- if (ttlStrategy == null) throw new ArgumentNullException(nameof(ttlStrategy));
- if (cacheKeyStrategy == null) throw new ArgumentNullException(nameof(cacheKeyStrategy));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
+ if (ttlStrategy == null)
+ throw new ArgumentNullException(nameof(ttlStrategy));
+ if (cacheKeyStrategy == null)
+ throw new ArgumentNullException(nameof(cacheKeyStrategy));
Action emptyDelegate = (_, _) => { };
@@ -105,9 +108,12 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvider, TimeSpan ttl,
/// cacheKeyStrategy
public static CachePolicy Cache(ISyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, Func cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
- if (ttlStrategy == null) throw new ArgumentNullException(nameof(ttlStrategy));
- if (cacheKeyStrategy == null) throw new ArgumentNullException(nameof(cacheKeyStrategy));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
+ if (ttlStrategy == null)
+ throw new ArgumentNullException(nameof(ttlStrategy));
+ if (cacheKeyStrategy == null)
+ throw new ArgumentNullException(nameof(cacheKeyStrategy));
Action emptyDelegate = (_, _) => { };
@@ -308,13 +314,19 @@ public static CachePolicy Cache(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
- if (ttlStrategy == null) throw new ArgumentNullException(nameof(ttlStrategy));
- if (cacheKeyStrategy == null) throw new ArgumentNullException(nameof(cacheKeyStrategy));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
+ if (ttlStrategy == null)
+ throw new ArgumentNullException(nameof(ttlStrategy));
+ if (cacheKeyStrategy == null)
+ throw new ArgumentNullException(nameof(cacheKeyStrategy));
- if (onCacheGet == null) throw new ArgumentNullException(nameof(onCacheGet));
- if (onCacheMiss == null) throw new ArgumentNullException(nameof(onCacheMiss));
- if (onCachePut == null) throw new ArgumentNullException(nameof(onCachePut));
+ if (onCacheGet == null)
+ throw new ArgumentNullException(nameof(onCacheGet));
+ if (onCacheMiss == null)
+ throw new ArgumentNullException(nameof(onCacheMiss));
+ if (onCachePut == null)
+ throw new ArgumentNullException(nameof(onCachePut));
return new CachePolicy(cacheProvider, ttlStrategy, cacheKeyStrategy, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
diff --git a/src/Polly/Caching/CacheTResultSyntax.cs b/src/Polly/Caching/CacheTResultSyntax.cs
index 9e3ed6666d0..737a27671cd 100644
--- a/src/Polly/Caching/CacheTResultSyntax.cs
+++ b/src/Polly/Caching/CacheTResultSyntax.cs
@@ -16,7 +16,8 @@ public partial class Policy
/// cacheProvider
public static CachePolicy Cache(ISyncCacheProvider cacheProvider, TimeSpan ttl, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), new RelativeTtl(ttl), DefaultCacheKeyStrategy.Instance.GetCacheKey, onCacheError);
}
@@ -35,7 +36,8 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid
/// ttlStrategy
public static CachePolicy Cache(ISyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), ttlStrategy, DefaultCacheKeyStrategy.Instance.GetCacheKey, onCacheError);
}
@@ -55,7 +57,8 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid
/// cacheKeyStrategy
public static CachePolicy Cache(ISyncCacheProvider cacheProvider, TimeSpan ttl, ICacheKeyStrategy cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), new RelativeTtl(ttl), cacheKeyStrategy.GetCacheKey, onCacheError);
}
@@ -76,7 +79,8 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid
/// cacheKeyStrategy
public static CachePolicy Cache(ISyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, ICacheKeyStrategy cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), ttlStrategy, cacheKeyStrategy.GetCacheKey, onCacheError);
}
@@ -96,7 +100,8 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid
/// cacheKeyStrategy
public static CachePolicy Cache(ISyncCacheProvider cacheProvider, TimeSpan ttl, Func cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), new RelativeTtl(ttl), cacheKeyStrategy, onCacheError);
}
@@ -117,7 +122,8 @@ public static CachePolicy Cache(ISyncCacheProvider cacheProvid
/// cacheKeyStrategy
public static CachePolicy Cache(ISyncCacheProvider cacheProvider, ITtlStrategy ttlStrategy, Func cacheKeyStrategy, Action? onCacheError = null)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), ttlStrategy, cacheKeyStrategy, onCacheError);
}
@@ -149,7 +155,8 @@ public static CachePolicy Cache(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), new RelativeTtl(ttl), DefaultCacheKeyStrategy.Instance.GetCacheKey, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -182,7 +189,8 @@ public static CachePolicy Cache(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), ttlStrategy, DefaultCacheKeyStrategy.Instance.GetCacheKey, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -217,7 +225,8 @@ public static CachePolicy Cache(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), new RelativeTtl(ttl), cacheKeyStrategy.GetCacheKey, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -253,7 +262,8 @@ public static CachePolicy Cache(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), ttlStrategy, cacheKeyStrategy.GetCacheKey, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -288,7 +298,8 @@ public static CachePolicy Cache(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), new RelativeTtl(ttl), cacheKeyStrategy, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -324,7 +335,8 @@ public static CachePolicy Cache(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
return Cache(cacheProvider.For(), ttlStrategy, cacheKeyStrategy, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
@@ -772,13 +784,19 @@ public static CachePolicy Cache(
Action? onCacheGetError,
Action? onCachePutError)
{
- if (cacheProvider == null) throw new ArgumentNullException(nameof(cacheProvider));
- if (ttlStrategy == null) throw new ArgumentNullException(nameof(ttlStrategy));
- if (cacheKeyStrategy == null) throw new ArgumentNullException(nameof(cacheKeyStrategy));
-
- if (onCacheGet == null) throw new ArgumentNullException(nameof(onCacheGet));
- if (onCacheMiss == null) throw new ArgumentNullException(nameof(onCacheMiss));
- if (onCachePut == null) throw new ArgumentNullException(nameof(onCachePut));
+ if (cacheProvider == null)
+ throw new ArgumentNullException(nameof(cacheProvider));
+ if (ttlStrategy == null)
+ throw new ArgumentNullException(nameof(ttlStrategy));
+ if (cacheKeyStrategy == null)
+ throw new ArgumentNullException(nameof(cacheKeyStrategy));
+
+ if (onCacheGet == null)
+ throw new ArgumentNullException(nameof(onCacheGet));
+ if (onCacheMiss == null)
+ throw new ArgumentNullException(nameof(onCacheMiss));
+ if (onCachePut == null)
+ throw new ArgumentNullException(nameof(onCachePut));
return new CachePolicy(cacheProvider, ttlStrategy, cacheKeyStrategy, onCacheGet, onCacheMiss, onCachePut, onCacheGetError, onCachePutError);
}
diff --git a/src/Polly/Caching/ContextualTtl.cs b/src/Polly/Caching/ContextualTtl.cs
index b02b7cba9ba..c45e23a327b 100644
--- a/src/Polly/Caching/ContextualTtl.cs
+++ b/src/Polly/Caching/ContextualTtl.cs
@@ -27,7 +27,8 @@ public class ContextualTtl : ITtlStrategy
/// TimeSpan.
public Ttl GetTtl(Context context, object? result)
{
- if (!context.ContainsKey(TimeSpanKey)) return _noTtl;
+ if (!context.ContainsKey(TimeSpanKey))
+ return _noTtl;
bool sliding = false;
diff --git a/src/Polly/Caching/GenericCacheProvider.cs b/src/Polly/Caching/GenericCacheProvider.cs
index b35bdd56406..73b617b667f 100644
--- a/src/Polly/Caching/GenericCacheProvider.cs
+++ b/src/Polly/Caching/GenericCacheProvider.cs
@@ -15,7 +15,7 @@ internal GenericCacheProvider(ISyncCacheProvider nonGenericCacheProvider) =>
(bool, TCacheFormat?) ISyncCacheProvider.TryGet(string key)
{
(bool cacheHit, object? result) = _wrappedCacheProvider.TryGet(key);
- return (cacheHit, (TCacheFormat?) (result ?? default(TCacheFormat)));
+ return (cacheHit, (TCacheFormat?)(result ?? default(TCacheFormat)));
}
void ISyncCacheProvider.Put(string key, TCacheFormat? value, Ttl ttl) =>
diff --git a/src/Polly/Caching/RelativeTtl.cs b/src/Polly/Caching/RelativeTtl.cs
index b8acfb64049..de192d9a8d9 100644
--- a/src/Polly/Caching/RelativeTtl.cs
+++ b/src/Polly/Caching/RelativeTtl.cs
@@ -14,7 +14,8 @@ public class RelativeTtl : ITtlStrategy
/// The timespan for which to consider the cache item valid.
public RelativeTtl(TimeSpan ttl)
{
- if (ttl < TimeSpan.Zero) throw new ArgumentOutOfRangeException(nameof(ttl), "The ttl for items to cache must be greater than zero.");
+ if (ttl < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException(nameof(ttl), "The ttl for items to cache must be greater than zero.");
this.ttl = ttl;
}
diff --git a/src/Polly/Caching/ResultTtl.cs b/src/Polly/Caching/ResultTtl.cs
index d4192fc2c40..957a821f2a9 100644
--- a/src/Polly/Caching/ResultTtl.cs
+++ b/src/Polly/Caching/ResultTtl.cs
@@ -15,7 +15,8 @@ public class ResultTtl : ITtlStrategy
/// The function to calculate the TTL for which cache items should be considered valid.
public ResultTtl(Func ttlFunc)
{
- if (ttlFunc == null) throw new ArgumentNullException(nameof(ttlFunc));
+ if (ttlFunc == null)
+ throw new ArgumentNullException(nameof(ttlFunc));
_ttlFunc = (_, result) => ttlFunc(result);
}
diff --git a/src/Polly/Caching/SlidingTtl.cs b/src/Polly/Caching/SlidingTtl.cs
index e8b5cd84363..7ef4feb3462 100644
--- a/src/Polly/Caching/SlidingTtl.cs
+++ b/src/Polly/Caching/SlidingTtl.cs
@@ -14,7 +14,8 @@ public class SlidingTtl : ITtlStrategy
/// The sliding timespan for which cache items should be considered valid.
public SlidingTtl(TimeSpan slidingTtl)
{
- if (slidingTtl < TimeSpan.Zero) throw new ArgumentOutOfRangeException(nameof(slidingTtl), "The ttl for items to cache must be greater than zero.");
+ if (slidingTtl < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException(nameof(slidingTtl), "The ttl for items to cache must be greater than zero.");
ttl = new Ttl(slidingTtl, true);
}
diff --git a/src/Polly/CircuitBreaker/AdvancedCircuitBreakerSyntax.cs b/src/Polly/CircuitBreaker/AdvancedCircuitBreakerSyntax.cs
index 1b865a9e5f7..51e71f4102d 100644
--- a/src/Polly/CircuitBreaker/AdvancedCircuitBreakerSyntax.cs
+++ b/src/Polly/CircuitBreaker/AdvancedCircuitBreakerSyntax.cs
@@ -211,19 +211,35 @@ public static CircuitBreakerPolicy AdvancedCircuitBreaker(this PolicyBuilder pol
/// onReset
/// onHalfOpen
/// (see "Release It!" by Michael T. Nygard fi)
- public static CircuitBreakerPolicy AdvancedCircuitBreaker(this PolicyBuilder policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action onBreak, Action onReset, Action onHalfOpen)
+ public static CircuitBreakerPolicy AdvancedCircuitBreaker(
+ this PolicyBuilder policyBuilder,
+ double failureThreshold,
+ TimeSpan samplingDuration,
+ int minimumThroughput,
+ TimeSpan durationOfBreak,
+ Action onBreak,
+ Action onReset,
+ Action onHalfOpen)
{
var resolutionOfCircuit = TimeSpan.FromTicks(AdvancedCircuitController.ResolutionOfCircuitTimer);
- if (failureThreshold <= 0) throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be greater than zero.");
- if (failureThreshold > 1) throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be less than or equal to one.");
- if (samplingDuration < resolutionOfCircuit) throw new ArgumentOutOfRangeException(nameof(samplingDuration), $"Value must be equal to or greater than {resolutionOfCircuit.TotalMilliseconds} milliseconds. This is the minimum resolution of the CircuitBreaker timer.");
- if (minimumThroughput <= 1) throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "Value must be greater than one.");
- if (durationOfBreak < TimeSpan.Zero) throw new ArgumentOutOfRangeException(nameof(durationOfBreak), "Value must be greater than zero.");
+ if (failureThreshold <= 0)
+ throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be greater than zero.");
+ if (failureThreshold > 1)
+ throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be less than or equal to one.");
+ if (samplingDuration < resolutionOfCircuit)
+ throw new ArgumentOutOfRangeException(nameof(samplingDuration), $"Value must be equal to or greater than {resolutionOfCircuit.TotalMilliseconds} milliseconds. This is the minimum resolution of the CircuitBreaker timer.");
+ if (minimumThroughput <= 1)
+ throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "Value must be greater than one.");
+ if (durationOfBreak < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException(nameof(durationOfBreak), "Value must be greater than zero.");
- if (onBreak == null) throw new ArgumentNullException(nameof(onBreak));
- if (onReset == null) throw new ArgumentNullException(nameof(onReset));
- if (onHalfOpen == null) throw new ArgumentNullException(nameof(onHalfOpen));
+ if (onBreak == null)
+ throw new ArgumentNullException(nameof(onBreak));
+ if (onReset == null)
+ throw new ArgumentNullException(nameof(onReset));
+ if (onHalfOpen == null)
+ throw new ArgumentNullException(nameof(onHalfOpen));
var breakerController = new AdvancedCircuitController(
failureThreshold,
diff --git a/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs b/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs
index d34c57e4af0..91c5a11d649 100644
--- a/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs
+++ b/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs
@@ -213,19 +213,35 @@ public static CircuitBreakerPolicy AdvancedCircuitBreaker(this
/// onReset
/// onHalfOpen
/// (see "Release It!" by Michael T. Nygard fi)
- public static CircuitBreakerPolicy AdvancedCircuitBreaker(this PolicyBuilder policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action, CircuitState, TimeSpan, Context> onBreak, Action onReset, Action onHalfOpen)
+ public static CircuitBreakerPolicy AdvancedCircuitBreaker(
+ this PolicyBuilder policyBuilder,
+ double failureThreshold,
+ TimeSpan samplingDuration,
+ int minimumThroughput,
+ TimeSpan durationOfBreak,
+ Action, CircuitState, TimeSpan, Context> onBreak,
+ Action onReset,
+ Action onHalfOpen)
{
var resolutionOfCircuit = TimeSpan.FromTicks(AdvancedCircuitController.ResolutionOfCircuitTimer);
- if (failureThreshold <= 0) throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be greater than zero.");
- if (failureThreshold > 1) throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be less than or equal to one.");
- if (samplingDuration < resolutionOfCircuit) throw new ArgumentOutOfRangeException(nameof(samplingDuration), $"Value must be equal to or greater than {resolutionOfCircuit.TotalMilliseconds} milliseconds. This is the minimum resolution of the CircuitBreaker timer.");
- if (minimumThroughput <= 1) throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "Value must be greater than one.");
- if (durationOfBreak < TimeSpan.Zero) throw new ArgumentOutOfRangeException(nameof(durationOfBreak), "Value must be greater than zero.");
+ if (failureThreshold <= 0)
+ throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be greater than zero.");
+ if (failureThreshold > 1)
+ throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be less than or equal to one.");
+ if (samplingDuration < resolutionOfCircuit)
+ throw new ArgumentOutOfRangeException(nameof(samplingDuration), $"Value must be equal to or greater than {resolutionOfCircuit.TotalMilliseconds} milliseconds. This is the minimum resolution of the CircuitBreaker timer.");
+ if (minimumThroughput <= 1)
+ throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "Value must be greater than one.");
+ if (durationOfBreak < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException(nameof(durationOfBreak), "Value must be greater than zero.");
- if (onBreak == null) throw new ArgumentNullException(nameof(onBreak));
- if (onReset == null) throw new ArgumentNullException(nameof(onReset));
- if (onHalfOpen == null) throw new ArgumentNullException(nameof(onHalfOpen));
+ if (onBreak == null)
+ throw new ArgumentNullException(nameof(onBreak));
+ if (onReset == null)
+ throw new ArgumentNullException(nameof(onReset));
+ if (onHalfOpen == null)
+ throw new ArgumentNullException(nameof(onHalfOpen));
var breakerController = new AdvancedCircuitController(
failureThreshold,
diff --git a/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs b/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs
index f9d25e21f4b..968d60a7aed 100644
--- a/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs
+++ b/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs
@@ -215,19 +215,34 @@ public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync(this PolicyB
/// onBreak
/// onReset
/// onHalfOpen
- public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync(this PolicyBuilder policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action onBreak, Action