-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 ResilienceStrategyBuilder #1058
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few things I spotted while reviewing the diff, but the API shape LGTM.
{ | ||
Validator.ValidateObject(Options, new ValidationContext(Options), true); | ||
|
||
if (_entries.Count == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any benefit to special-casing a count of 1
to skip the loop and/or wrapping something that's just a pass-through?
6b3f6bc
to
d006124
Compare
d006124
to
6f3f774
Compare
src/Polly.Core.Tests/Builder/ResilienceStrategyBuilderOptionsTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With all the changes you made this morning, this PR looks good to me.
The issue or feature being addressed
This PR adds a
ResilienceStrategyBuilder
class from v8-poc branch. It's used to build the instance ofIResilienceStrategy
.Details on the issue fix or feature implementation
The following primitives are added:
ResilienceStrategyBuilder
: the builder itself.ResilienceStrategyBuilderContext
: context that caries details for the strategy factory.ResilienceStrategyBuilderOptions
: the options of the builder. These will be epxanded later with more members such as clock, logging, telemetry.ResilienceStrategyOptions
: the options attached to individual strategy.I'll add tests once we agree on the API surface.
Confirm the following