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

Rename ResilienceStrategy to ResiliencePipeline #1483

Merged
merged 8 commits into from
Aug 14, 2023
Merged

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Aug 11, 2023

Details on the issue fix or feature implementation

Based on the API review:
#1233 (comment)

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 added the v8 Issues related to the new version 8 of the Polly library. label Aug 11, 2023
@martintmk martintmk added this to the v8.0.0 milestone Aug 11, 2023
@codecov
Copy link

codecov bot commented Aug 13, 2023

Codecov Report

Merging #1483 (35a10db) into main (4e6afb3) will not change coverage.
The diff coverage is 97.72%.

@@           Coverage Diff           @@
##             main    #1483   +/-   ##
=======================================
  Coverage   83.89%   83.89%           
=======================================
  Files         278      278           
  Lines        6496     6496           
  Branches     1016     1016           
=======================================
  Hits         5450     5450           
  Misses        837      837           
  Partials      209      209           
Flag Coverage Δ
linux 83.89% <97.72%> (ø)
macos 83.89% <97.72%> (?)
windows 83.89% <97.72%> (?)

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

Files Changed Coverage Δ
...rcuitBreakerResiliencePipelineBuilderExtensions.cs 100.00% <ø> (ø)
...CircuitBreaker/CircuitBreakerResilienceStrategy.cs 100.00% <ø> (ø)
...Core/CircuitBreaker/CircuitBreakerStateProvider.cs 100.00% <ø> (ø)
...ack/FallbackResiliencePipelineBuilderExtensions.cs 100.00% <ø> (ø)
.../Polly.Core/Fallback/FallbackResilienceStrategy.cs 100.00% <ø> (ø)
...ging/HedgingResiliencePipelineBuilderExtensions.cs 100.00% <ø> (ø)
...rc/Polly.Core/Hedging/HedgingResilienceStrategy.cs 100.00% <ø> (ø)
src/Polly.Core/ResilienceContext.cs 100.00% <ø> (ø)
src/Polly.Core/ResiliencePipeline.Async.cs 100.00% <ø> (ø)
src/Polly.Core/ResiliencePipeline.AsyncT.cs 100.00% <ø> (ø)
... and 45 more

@martintmk martintmk marked this pull request as ready for review August 13, 2023 15:44
@peter-csala
Copy link
Contributor

@martintmk Did I miss something? I though you are against the usage of the term pipeline?

@martintmk
Copy link
Contributor Author

@martintmk Did I miss something? I though you are against the usage of the term pipeline?

We did some brainstorming and realized we need to differentiate between "pipeline" (was strategy before) and a component of a pipeline (individual resilience strategy).

The end consumer (majority) of an API only cares about ResiliencePipeline. The ResiliencePipeline can only ever be created by using ResiliencePipelineBuilder. Its creation and state is fully under our control, so both ResiliencePipeline and ResiliencePipeline<T> is sealed and with internal constructor. This allows us to evolve and optimize the internal implementations without breaking changes.

The resilience author (minority) cares about ResilienceStrategy and ResilienceStrategy<T>, they have simple and straightforward base class to implement followed by exposing extensions for ResiliencePipelineBuilder.

@martintmk martintmk merged commit 76f181f into main Aug 14, 2023
16 checks passed
@martintmk martintmk deleted the mtomka/renames branch August 14, 2023 08:24
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