You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -309,7 +309,9 @@ Policy
309
309
});
310
310
```
311
311
312
-
For more detail see: [Retry policy documentation](https://github.com/App-vNext/Polly/wiki/Retry) on wiki.
312
+
If all retries fail, a retry policy rethrows the final exception back to the calling code.
313
+
314
+
For more depth see also: [Retry policy documentation on wiki](https://github.com/App-vNext/Polly/wiki/Retry).
313
315
314
316
### Circuit Breaker
315
317
@@ -355,7 +357,10 @@ breaker.Isolate();
355
357
breaker.Reset();
356
358
357
359
```
358
-
For more detail see: [Circuit-Breaker documentation](https://github.com/App-vNext/Polly/wiki/Circuit-Breaker) on wiki.
360
+
361
+
Note that circuit-breaker policies [rethrow all exceptions](https://github.com/App-vNext/Polly/wiki/Circuit-Breaker#exception-handling), even handled ones. A circuit-breaker exists to measure faults and break the circuit when too many faults occur, but does not orchestrate retries. Combine a circuit-breaker with a retry policy as needed.
362
+
363
+
For more depth see also: [Circuit-Breaker documentation on wiki](https://github.com/App-vNext/Polly/wiki/Circuit-Breaker).
359
364
360
365
### Advanced Circuit Breaker
361
366
```csharp
@@ -589,22 +594,27 @@ For more detail see: [Bulkhead policy documentation](https://github.com/App-vNex
// Execute through the cache as a read-through cache: check the cache first; if not found, execute underlying delegate and store the result in the cache.
599
-
TResultresult=cachePolicy.Execute(() =>getFoo(), newContext("FooKey")); // "FooKey" is the cache key used in this execution.
600
-
601
607
// Define a cache Policy, and catch any cache provider errors for logging.
// Execute through the cache as a read-through cache: check the cache first; if not found, execute underlying delegate and store the result in the cache.
615
+
// The key to use for caching, for a particular execution, is specified by setting the OperationKey (before v6: ExecutionKey) on a Context instance passed to the execution. Use an overload of the form shown below (or a richer overload including the same elements).
616
+
// Example: "FooKey" is the cache key that will be used in the below execution.
@@ -980,6 +990,8 @@ For full detailed of supported targets by version, see [supported targets](https
980
990
* [@benagain](https://github.com/benagain) - Bug fix: RelativeTtl in CachePolicy now always returns a ttl relative to time item is cached.
981
991
* [@urig](https://github.com/urig) - Allow TimeoutPolicy to be configured with Timeout.InfiniteTimeSpan.
982
992
* [@reisenberger](https://github.com/reisenberger) - Integration with [IHttpClientFactory](https://github.com/aspnet/HttpClientFactory/) for ASPNET Core 2.1.
993
+
* [@freakazoid182](https://github.com/Freakazoid182) - WaitAnd/RetryForever overloads where onRetry takes the retry number as a parameter.
994
+
* [@dustyhoppe](https://github.com/dustyhoppe) - Overloads where onTimeout takes thrown exception as a parameter
if(_syncCacheProvider==null)thrownewInvalidOperationException("Please use the synchronous-defined policies when calling the synchronous Execute (and similar) methods.");
0 commit comments