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

Introduce NonReactiveResilienceStrategy #1476

Merged
merged 6 commits into from
Aug 10, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Aug 10, 2023

Details on the issue fix or feature implementation

The follow-up of #1462 that introduces the base class for non-reactive resilience strategies.

Additional changes:

  • Make the construction of ResilienceStrategy internal (similar to ResilienceStrategy<T>). We now have full control over these top-level types.

This change make the decision when implementing a new resilience strategy straightforward:

  • Pick NonReactiveResilienceStrategy when you want to implement non-reactive strategy.
  • Pick ReactiveResilienceStrategy<T> when you want to implement reactive strategy.

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 10, 2023
@martintmk martintmk added this to the v8.0.0 milestone Aug 10, 2023
@martintmk martintmk marked this pull request as ready for review August 10, 2023 09:48
public abstract class NonReactiveResilienceStrategy
{
/// <summary>
/// An implementation of non-reactive resilience strategy that executes the specified <paramref name="callback"/>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// An implementation of non-reactive resilience strategy that executes the specified <paramref name="callback"/>.
/// An implementation of a non-reactive resilience strategy that executes the specified <paramref name="callback"/>.

src/Polly.Testing/ResilienceStrategyExtensions.cs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #1476 (7c6cc04) into main (5f253dc) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1476      +/-   ##
==========================================
+ Coverage   83.90%   83.92%   +0.02%     
==========================================
  Files         275      276       +1     
  Lines        6498     6508      +10     
  Branches     1015     1016       +1     
==========================================
+ Hits         5452     5462      +10     
  Misses        837      837              
  Partials      209      209              
Flag Coverage Δ
linux ?
macos 83.92% <100.00%> (+0.02%) ⬆️
windows 83.92% <100.00%> (+0.02%) ⬆️

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

Files Changed Coverage Δ
src/Polly.Core/NullResilienceStrategy.cs 100.00% <ø> (ø)
...rc/Polly.Core/Timeout/TimeoutResilienceStrategy.cs 100.00% <ø> (ø)
...rc/Polly.Core/Utils/CompositeResilienceStrategy.cs 100.00% <ø> (ø)
...lly.Core/Utils/ReactiveResilienceStrategyBridge.cs 100.00% <ø> (ø)
...c/Polly.Core/Utils/ReloadableResilienceStrategy.cs 100.00% <ø> (ø)
...xtensions/Telemetry/TelemetryResilienceStrategy.cs 100.00% <ø> (ø)
...olly.RateLimiting/RateLimiterResilienceStrategy.cs 100.00% <ø> (ø)
...c/Polly.Core/CompositeStrategyBuilderExtensions.cs 100.00% <100.00%> (ø)
src/Polly.Core/ResilienceStrategy.cs 100.00% <100.00%> (ø)
....Core/Utils/NonReactiveResilienceStrategyBridge.cs 100.00% <100.00%> (ø)
... and 2 more

@martintmk martintmk merged commit 3663510 into main Aug 10, 2023
16 checks passed
@martintmk martintmk deleted the mtomka/introduce-NonReactiveResilienceStrategy branch August 10, 2023 14:12
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.

2 participants