Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize the callback API #1137

Merged
merged 6 commits into from
Apr 17, 2023
Merged

Finalize the callback API #1137

merged 6 commits into from
Apr 17, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Apr 17, 2023

Details on the issue fix or feature implementation

This PR finalizes and cleans-up the callback API.

  • Introducing NoOutcomeGenerator and dropping TimeoutGenerator
  • Introducing TResult based class for Generators and Events
  • To verify the API a new generic ResilienceStrategyOptions<TResult> are introduced. The user will use these when they care only about specific result type. These can be easily converted to ResilienceStrategyOptions.

I hope with this PR the callback API is almost done only minor changes (if any) will be done later.

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

@martintmk martintmk self-assigned this Apr 17, 2023
@martintmk martintmk added the v8 Issues related to the new version 8 of the Polly library. label Apr 17, 2023
@martintmk martintmk added this to the v8.0.0 milestone Apr 17, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2023

Codecov Report

Merging #1137 (de36128) into main (2aea2f2) will increase coverage by 0.33%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #1137      +/-   ##
==========================================
+ Coverage   78.14%   78.48%   +0.33%     
==========================================
  Files         201      204       +3     
  Lines        4846     4922      +76     
  Branches      863      869       +6     
==========================================
+ Hits         3787     3863      +76     
  Misses        854      854              
  Partials      205      205              
Flag Coverage Δ
linux 78.48% <100.00%> (+0.33%) ⬆️
macos ?
windows 78.48% <100.00%> (+0.33%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../Retry/RetryResilienceStrategyBuilderExtensions.cs 100.00% <100.00%> (ø)
...c/Polly.Core/Retry/RetryStrategyOptions.TResult.cs 100.00% <100.00%> (ø)
src/Polly.Core/Strategy/NoOutcomeGenerator.cs 100.00% <100.00%> (ø)
src/Polly.Core/Strategy/OutcomeEvent.Handler.cs 100.00% <100.00%> (ø)
src/Polly.Core/Strategy/OutcomeEvent.TResult.cs 100.00% <100.00%> (ø)
src/Polly.Core/Strategy/OutcomeEvent.cs 100.00% <100.00%> (ø)
...rc/Polly.Core/Strategy/OutcomeGenerator.Handler.cs 100.00% <100.00%> (ø)
...rc/Polly.Core/Strategy/OutcomeGenerator.TResult.cs 100.00% <100.00%> (ø)
src/Polly.Core/Strategy/OutcomeGenerator.cs 100.00% <100.00%> (ø)
src/Polly.Core/Strategy/OutcomePredicate.cs 100.00% <100.00%> (ø)
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

src/Polly.Core/Strategy/NoOutcomeGenerator.cs Outdated Show resolved Hide resolved
src/Polly.Core/Strategy/NoOutcomeGenerator.cs Outdated Show resolved Hide resolved
src/Polly.Core/Strategy/OutcomeEvent.cs Outdated Show resolved Hide resolved
src/Polly.Core/Strategy/OutcomeEvent.cs Outdated Show resolved Hide resolved
src/Polly.Core/Strategy/OutcomeEvent.cs Outdated Show resolved Hide resolved
src/Polly.Core/Strategy/OutcomeGenerator.cs Outdated Show resolved Hide resolved
src/Polly.Core/Strategy/OutcomeGenerator.cs Show resolved Hide resolved
src/Polly.Core/Strategy/OutcomeGenerator.cs Outdated Show resolved Hide resolved
src/Polly.Core/Strategy/OutcomeGenerator.cs Outdated Show resolved Hide resolved
src/Polly.Core/Strategy/OutcomePredicate.cs Outdated Show resolved Hide resolved
@martintmk martintmk enabled auto-merge (squash) April 17, 2023 12:00
@martintmk martintmk merged commit 6c80878 into main Apr 17, 2023
@martintmk martintmk deleted the mtomka/outcomeevent branch April 17, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 Issues related to the new version 8 of the Polly library.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants