Skip to content

Commit

Permalink
Updates for beta.1 (#1531)
Browse files Browse the repository at this point in the history
- Update CHANGELOG.
- Bump samples to 8.0.0-beta.1.
- React to breaking changes since alpha.9.
  • Loading branch information
martincostello authored Aug 31, 2023
1 parent a7cb07c commit 28bf72a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 8.0.0-beta.1

* Updates for alpha.9 by [@martincostello](https://github.com/martincostello) in https://github.com/App-vNext/Polly/pull/1526
* Finalize the API review by [@martintmk](https://github.com/martintmk) in https://github.com/App-vNext/Polly/pull/1528
* Disposing pipeline should not dispose external inner pipeline by [@martintmk](https://github.com/martintmk) in https://github.com/App-vNext/Polly/pull/1529
* Clean duplications around disposing the pipelines by [@martintmk](https://github.com/martintmk) in https://github.com/App-vNext/Polly/pull/1530

## 8.0.0-alpha.9

* Updates for alpha.8 by [@martincostello](https://github.com/martincostello) in https://github.com/App-vNext/Polly/pull/1465
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<MicrosoftExtensionsVersion>7.0.0</MicrosoftExtensionsVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<PollyVersion>8.0.0-alpha.9</PollyVersion>
<PollyVersion>8.0.0-beta.1</PollyVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="coverlet.msbuild" Version="6.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
> Major performance improvements are on the way! Please see our [blog post](https://www.thepollyproject.org/2023/03/03/we-want-your-feedback-introducing-polly-v8/) to learn more and provide feedback in the [related GitHub issue](https://github.com/App-vNext/Polly/issues/1048).
>
> :rotating_light::rotating_light: **Polly v8 feature-complete!** :rotating_light::rotating_light:
> - Polly v8 Alpha 9 is now available on [NuGet.org](https://www.nuget.org/packages/Polly/8.0.0-alpha.9)
> - The Alpha 9 version is considered feature-complete. After completing [review of the API](https://github.com/App-vNext/Polly/pull/1233) to address unresolved issues, we will move on to a Beta release.
> - Polly v8 Beta 1 is now available on [NuGet.org](https://www.nuget.org/packages/Polly/8.0.0-beta.1)
> - The Beta 1 version is considered feature-complete and the public API surface is stable.
> - The v8 docs are not yet finished, but you can take a look at sample code in these locations:
> - Within the repo's new [Samples folder](https://github.com/App-vNext/Polly/tree/main/samples)
> - By reading `Polly.Core`'s [README](https://github.com/App-vNext/Polly/blob/main/src/Polly.Core/README.md)
Expand Down
8 changes: 4 additions & 4 deletions samples/GenericStrategies/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
FallbackAction = _ =>
{
// Return fallback result
return Outcome.FromResultAsTask(new HttpResponseMessage(HttpStatusCode.OK));
return Outcome.FromResultAsValueTask(new HttpResponseMessage(HttpStatusCode.OK));
},
// You can also use switch expressions for succinct syntax
ShouldHandle = arguments => arguments.Outcome switch
{
// The "PredicateResult.True" is shorthand to "new ValueTask<bool>(true)"
{ Exception: HttpRequestException } => PredicateResult.True,
{ Result: HttpResponseMessage response } when response.StatusCode == HttpStatusCode.InternalServerError => PredicateResult.True,
_ => PredicateResult.False
{ Exception: HttpRequestException } => PredicateResult.True(),
{ Result: HttpResponseMessage response } when response.StatusCode == HttpStatusCode.InternalServerError => PredicateResult.True(),
_ => PredicateResult.False()
},
OnFallback = _ =>
{
Expand Down
4 changes: 2 additions & 2 deletions samples/Intro/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
// To configure the predicate you can use switch expressions
ShouldHandle = args => args.Outcome.Exception switch
{
TimeoutRejectedException => PredicateResult.True,
TimeoutRejectedException => PredicateResult.True(),
// The "PredicateResult.False" is just shorthand for "new ValueTask<bool>(true)"
// You can also use "new PredicateBuilder().Handle<TimeoutRejectedException>()"
_ => PredicateResult.False
_ => PredicateResult.False()
},
// Register user callback called whenever retry occurs
OnRetry = args =>
Expand Down
8 changes: 4 additions & 4 deletions samples/Retries/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
// Specify what exceptions should be retried using switch expressions
ShouldHandle = args => args.Outcome.Exception switch
{
InvalidOperationException => PredicateResult.True,
_ => PredicateResult.False,
InvalidOperationException => PredicateResult.True(),
_ => PredicateResult.False(),
},
OnRetry = outcome =>
{
Expand Down Expand Up @@ -82,11 +82,11 @@
arguments.Outcome.Result.Headers.TryGetValues("Retry-After", out var value))
{
// Return delay based on header
return new ValueTask<TimeSpan>(TimeSpan.FromSeconds(int.Parse(value.Single())));
return new ValueTask<TimeSpan?>(TimeSpan.FromSeconds(int.Parse(value.Single())));
}
// Return delay hinted by the retry strategy
return new ValueTask<TimeSpan>(arguments.DelayHint);
return new ValueTask<TimeSpan?>(default(TimeSpan?));
}
})
.Build();
Expand Down

0 comments on commit 28bf72a

Please sign in to comment.