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 IResilienceStrategy and core primitives for V8 #1056

Merged
merged 6 commits into from
Mar 16, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Mar 15, 2023

The issue or feature being addressed

In this PR I am transferring some core primitives from v8-poc branch. This includes:

  • Adding documentation.
  • Adding code-guards.
  • Polishing and improving the API.

Details on the issue fix or feature implementation

To keep thing simple I am omitting the following:

  • Pooling of ResilienceContext instances.
  • Additional Execute extensions as there will be many of these (to be done in follow-up).

I'll include the tests once we agree on API shape.

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

@geeknoid
Copy link
Contributor

Note that the default object pool in .NET has terrible scaling characteristics in scenarios where many pooled objects exist and are accessed in a concurrent fashion. The default pool was originally designed for very short-term object rentals and it just doesn't work well for long-term rentals.

I fixed this for .NET 8. In the meantime, you may wish to grab the .NET 8 implementation here and use it instead of the default .NET object pool.

https://github.com/dotnet/aspnetcore/blob/main/src/ObjectPool/src/DefaultObjectPool.cs

@martintmk
Copy link
Contributor Author

My thinking is just to copy that code here since the revisited version is pretty simple. And we will avoid extra dependency.

src/Polly.Core/ResilienceContext.cs Outdated Show resolved Hide resolved
@martintmk martintmk marked this pull request as ready for review March 16, 2023 11:02
@martintmk martintmk force-pushed the mtomka/introduce-IResilienceStrategy branch 2 times, most recently from 23fe66e to 7a39b2c Compare March 16, 2023 11:33
@martintmk martintmk force-pushed the mtomka/introduce-IResilienceStrategy branch from 7a39b2c to 8cb24d5 Compare March 16, 2023 11:39
src/Polly.Core/DelegatingResilienceStrategy.cs Outdated Show resolved Hide resolved
src/Polly.Core/IResilienceStrategy.cs Outdated Show resolved Hide resolved
src/Polly.Core/IResilienceStrategy.cs Outdated Show resolved Hide resolved
src/Polly.Core/IResilienceStrategy.cs Outdated Show resolved Hide resolved
src/Polly.Core/ResilienceStrategyExtensions.Async.Task.cs Outdated Show resolved Hide resolved
src/Polly.Core/Utils/Guard.cs Show resolved Hide resolved
@martintmk martintmk merged commit 0229729 into main Mar 16, 2023
@martincostello martincostello deleted the mtomka/introduce-IResilienceStrategy branch March 16, 2023 14:32
@martincostello martincostello added this to the v8.0.0 milestone Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants