Skip to content

Commit 1a351a8

Browse files
authored
Merge pull request #581 from App-vNext/v700
Merge v7.0.0 to master for v7.0.0 release
2 parents 2235d76 + 933e0d4 commit 1a351a8

File tree

239 files changed

+5359
-4801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+5359
-4801
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 7.0.0
2+
- Clarify separation of sync and async policies (breaking change)
3+
- Enable extensibility by custom policies hosted external to Polly
4+
- Enable collection initialization syntax for PolicyRegistry
5+
- Enable cache policies to cache default(TResult) (breaking change)
6+
- Restore Exception binary serialization for .Net Standard 2.0
7+
18
## 6.1.2
29
- Bug Fix: Async continuation control for async executions (issue 540, affected only v6.1.1)
310

GitVersionConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
next-version: 6.1.2
1+
next-version: 7.0.0

README.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,26 @@ In addition to the detailed pages on each policy, an [introduction to the role o
4040

4141
For using Polly with HttpClient factory from ASPNET Core 2.1, see our [detailed wiki page](https://github.com/App-vNext/Polly/wiki/Polly-and-HttpClientFactory), then come back here or [explore the wiki](https://github.com/App-vNext/Polly/wiki) to learn more about the operation of each policy.
4242

43-
# Usage – fault-handling policies
43+
### Release notes
44+
45+
+ The [change log](https://github.com/App-vNext/Polly/blob/master/CHANGELOG.md) describes changes by release.
46+
+ We tag Pull Requests and Issues with [milestones](https://github.com/App-vNext/Polly/milestones) which match to nuget package release numbers.
47+
+ Breaking changes are called out in the wiki ([v7](https://github.com/App-vNext/Polly/wiki/Polly-v7-breaking-changes) ; [v6](https://github.com/App-vNext/Polly/wiki/Polly-v6-breaking-changes)) with simple notes on any necessary steps to upgrade.
48+
49+
### Supported targets
50+
51+
For details of supported compilation targets by version, see the [supported targets](https://github.com/App-vNext/Polly/wiki/Supported-targets) grid.
52+
53+
### Role of the readme and the wiki
54+
55+
This ReadMe aims to give a quick overview of all Polly features - including enough to get you started with any policy. For deeper detail on any policy, and many other aspects of Polly, be sure also to check out the [wiki documentation](https://github.com/App-vNext/Polly/wiki).
56+
57+
# Usage – fault-handling, reactive policies
4458

4559
Fault-handling policies handle specific exceptions thrown by, or results returned by, the delegates you execute through the policy.
4660

4761
## Step 1 : Specify the exceptions/faults you want the policy to handle
4862

49-
### (for fault-handling policies: Retry family, CircuitBreaker family and Fallback)
50-
5163
```csharp
5264
// Single exception type
5365
Policy
@@ -359,9 +371,11 @@ breaker.Reset();
359371

360372
```
361373

374+
Circuit-breaker policies block exceptions by throwing `BrokenCircuitException` when the circuit is broken. See: [Circuit-Breaker documentation on wiki](https://github.com/App-vNext/Polly/wiki/Circuit-Breaker).
375+
362376
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.
363377

364-
For more depth see also: [Circuit-Breaker documentation on wiki](https://github.com/App-vNext/Polly/wiki/Circuit-Breaker).
378+
365379

366380
### Advanced Circuit Breaker
367381
```csharp
@@ -473,9 +487,9 @@ Policy
473487

474488
The above examples show policy definition immediately followed by policy execution, for simplicity. Policy definition and execution may just as often be separated in the codebase and application lifecycle. You may choose for example to define policies on start-up, then provide them to point-of-use by dependency injection (perhaps using [`PolicyRegistry`](#policyregistry)).
475489

476-
# Usage – general resilience policies
490+
# Usage – proactive policies
477491

478-
The general resilience policies add resilience strategies that are not explicitly centred around handling faults which delegates may throw or return.
492+
The proactive policies add resilience strategies that not based on handling faults which delegates may throw or return.
479493

480494
## Step 1 : Configure
481495

@@ -556,6 +570,8 @@ var response = await timeoutPolicy
556570
);
557571
```
558572

573+
Timeout policies throw `TimeoutRejectedException` when timeout occurs.
574+
559575
For more detail see: [Timeout policy documentation](https://github.com/App-vNext/Polly/wiki/Timeout) on wiki.
560576

561577
### Bulkhead
@@ -585,6 +601,8 @@ int freeQueueSlots = bulkhead.QueueAvailableCount;
585601

586602
```
587603

604+
Bulkhead policies throw `BulkheadRejectedException` if items are queued to the bulkhead when the bulkhead execution and queue are both full.
605+
588606

589607
For more detail see: [Bulkhead policy documentation](https://github.com/App-vNext/Polly/wiki/Bulkhead) on wiki.
590608

@@ -920,12 +938,6 @@ This allows collections of similar kinds of policy to be treated as one - for ex
920938
921939
For more detail see: [Polly and interfaces](https://github.com/App-vNext/Polly/wiki/Polly-and-interfaces) on wiki.
922940
923-
# Release notes
924-
925-
For details of changes by release see the [change log](https://github.com/App-vNext/Polly/blob/master/CHANGELOG.md). We also tag relevant Pull Requests and Issues with [milestones](https://github.com/App-vNext/Polly/milestones), which match to nuget package release numbers.
926-
927-
For full detailed of supported targets by version, see [supported targets](https://github.com/App-vNext/Polly/wiki/Supported-targets).
928-
929941
# 3rd Party Libraries and Contributions
930942

931943
* [Fluent Assertions](https://github.com/fluentassertions/fluentassertions) - A set of .NET extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style test | [Apache License 2.0 (Apache)](https://github.com/dennisdoomen/fluentassertions/blob/develop/LICENSE)
@@ -994,6 +1006,11 @@ For full detailed of supported targets by version, see [supported targets](https
9941006
* [@freakazoid182](https://github.com/Freakazoid182) - WaitAnd/RetryForever overloads where onRetry takes the retry number as a parameter.
9951007
* [@dustyhoppe](https://github.com/dustyhoppe) - Overloads where onTimeout takes thrown exception as a parameter.
9961008
* [@flin-zap](https://github.com/flin-zap) - Catch missing async continuation control.
1009+
* [@reisenberger](https://github.com/reisenberger) - Clarify separation of sync and async policies.
1010+
* [@reisenberger](https://github.com/reisenberger) - Enable extensibility by custom policies hosted external to Polly.
1011+
* [@seanfarrow](https://github.com/SeanFarrow) - Enable collection initialization syntax for PolicyRegistry.
1012+
* [@moerwald](https://github.com/moerwald) - Code clean-ups, usage of more concise C# members.
1013+
* [@cmeeren](https://github.com/cmeeren) - Enable cache policies to cache values of default(TResult).
9971014
9981015
# Sample Projects
9991016

@@ -1003,7 +1020,9 @@ For full detailed of supported targets by version, see [supported targets](https
10031020

10041021
# Instructions for Contributing
10051022

1006-
Please check out our [Wiki](https://github.com/App-vNext/Polly/wiki/Git-Workflow) for contributing guidelines. We are following the excellent GitHub Flow process, and would like to make sure you have all of the information needed to be a world-class contributor!
1023+
Please be sure to branch from the head of the latest vX.Y.Z dev branch (rather than master) when developing contributions.
1024+
1025+
For github workflow, check out our [Wiki](https://github.com/App-vNext/Polly/wiki/Git-Workflow). We are following the excellent GitHub Flow process, and would like to make sure you have all of the information needed to be a world-class contributor!
10071026
10081027
Since Polly is part of the .NET Foundation, we ask our contributors to abide by their [Code of Conduct](https://www.dotnetfoundation.org/code-of-conduct). To contribute (beyond trivial typo corrections), review and sign the [.Net Foundation Contributor License Agreement](https://cla.dotnetfoundation.org/). This ensures the community is free to use your contributions. The registration process can be completed entirely online.
10091028

build.cake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,6 @@ RunTarget(target);
302302
//////////////////////////////////////////////////////////////////////
303303

304304
string ToolsExePath(string exeFileName) {
305-
var exePath = System.IO.Directory.GetFiles(@".\Tools", exeFileName, SearchOption.AllDirectories).FirstOrDefault();
305+
var exePath = System.IO.Directory.GetFiles(@"./tools", exeFileName, SearchOption.AllDirectories).FirstOrDefault();
306306
return exePath;
307307
}

src/Polly.NetStandard11.Specs/Polly.NetStandard11.Specs.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<ItemGroup>
1818
<PackageReference Include="FluentAssertions" Version="4.19.3" />
1919
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
20+
<PackageReference Include="Moq" Version="4.10.1" />
2021
<PackageReference Include="xunit" Version="2.2.0" />
2122
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
2223
</ItemGroup>

src/Polly.NetStandard11/Polly.NetStandard11.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<AssemblyName>Polly</AssemblyName>
44
<AssemblyOriginatorKeyFile>..\Polly.Net45\Polly.snk</AssemblyOriginatorKeyFile>
5-
<DefineConstants>TRACE;PORTABLE</DefineConstants>
5+
<DefineConstants>TRACE</DefineConstants>
66
<DefaultLanguage>en-US</DefaultLanguage>
77
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -27,5 +27,8 @@
2727
<Link>Properties\GlobalAssemblyInfo.cs</Link>
2828
</Compile>
2929
</ItemGroup>
30+
<ItemGroup>
31+
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
32+
</ItemGroup>
3033
<Import Project="..\Polly.Shared\Polly.Shared.projitems" Label="Shared" />
3134
</Project>

src/Polly.NetStandard11/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
using System.Runtime.CompilerServices;
44

55
[assembly: AssemblyTitle("Polly")]
6-
[assembly: AssemblyInformationalVersion("6.1.1.0")]
7-
[assembly: AssemblyFileVersion("6.1.1.0")]
8-
[assembly: AssemblyVersion("6.0.0.0")]
6+
[assembly: AssemblyInformationalVersion("7.0.0.0")]
7+
[assembly: AssemblyFileVersion("7.0.0.0")]
8+
[assembly: AssemblyVersion("7.0.0.0")]
99
[assembly: CLSCompliant(true)]
1010

1111
[assembly: InternalsVisibleTo("Polly.NetStandard11.Specs")]

src/Polly.NetStandard20.Specs/Polly.NetStandard20.Specs.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<ItemGroup>
1818
<PackageReference Include="FluentAssertions" Version="4.19.3" />
1919
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
20+
<PackageReference Include="Moq" Version="4.10.1" />
2021
<PackageReference Include="xunit" Version="2.2.0" />
2122
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
2223
</ItemGroup>

src/Polly.NetStandard20/Polly.NetStandard20.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1111
<DebugType>full</DebugType>
12-
<DefineConstants>TRACE;DEBUG;PORTABLE;NETSTANDARD;NETSTANDARD2_0</DefineConstants>
12+
<DefineConstants>TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0</DefineConstants>
1313
</PropertyGroup>
1414
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
1515
<DebugType>pdbonly</DebugType>

src/Polly.NetStandard20/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
using System.Runtime.CompilerServices;
44

55
[assembly: AssemblyTitle("Polly")]
6-
[assembly: AssemblyInformationalVersion("6.1.1.0")]
7-
[assembly: AssemblyFileVersion("6.1.1.0")]
8-
[assembly: AssemblyVersion("6.0.0.0")]
6+
[assembly: AssemblyInformationalVersion("7.0.0.0")]
7+
[assembly: AssemblyFileVersion("7.0.0.0")]
8+
[assembly: AssemblyVersion("7.0.0.0")]
99
[assembly: CLSCompliant(true)]
1010

1111
[assembly: InternalsVisibleTo("Polly.NetStandard20.Specs")]

0 commit comments

Comments
 (0)