You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide an interface for the ResiliencePipelineProvider #1652
Is your feature request related to a specific problem? Or an existing feature? Please describe.
I like to be able to test classes usinghte new ResiliencePipelineProvider infrastructure. Currently this is made hard by the fact that there is no interface like the old registries.
Describe your proposed or preferred solution:
Can we have an IResiliencePipelineProvider that is registered with DI so that this can be injected in to classes.
Describe any alternative options you've considered:
There aren't really any for this problem.
Any additional info?
I'm happy to extract an interface an provide a PR if this is wanted for V8.
Does that and/or the Polly.Testing package help with what you're trying to achieve?
We're hours away from shipping Polly 8.0.0 and are basically code complete at this point, so I'm not sure at this point we'd delay to go through API review to consider adding new interfaces (we've avoided new interfaces for most (all?) of the new API surface).
There shouldn't be anything in the current design that prevents you from using DI and injecting things, they're just abstract classes instead of interfaces, and we have the empty builder you can use that is the successor to a no-op policy.
I think I can do what I need given that the methods in the ResiliencePipelineProvider are virtual or abstract.
If an interface isn’t an option (and it doesn’t make much sense having looked at this further), it may be worth adding something to the testing docs (post V8) to show how to mock out the ResiliencePipelineProvider as I can see people wanting to do this particularly when they are migrating from using the registry interfaces.
From: Martin Costello ***@***.***>
Sent: Wednesday, September 27, 2023 10:00 PM
To: App-vNext/Polly ***@***.***>
Cc: Sean Farrow ***@***.***>; Author ***@***.***>
Subject: Re: [App-vNext/Polly] Provide an interface for the ResiliencePipelineProvider (Issue #1652)
Have you taken a look at our new Polly v8 documentation for testing<#1651>?
Does that and/or the Polly.Testing package help with what you're trying to achieve.
We're hours away from shipping Polly 8.0.0 and are basically code complete at this point, so I'm not sure at this point we'd delay to go through API review to consider adding new interfaces (we've avoided new interfaces for most (all?) of the new API surface).
There shouldn't be anything in the current design that prevents you from using DI and injecting things, they're just abstract classes instead of interfaces, and we have the empty builder you can use that is the successor to a no-op policy.
—
Reply to this email directly, view it on GitHub<#1652 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALDK7UHNQGPX4TX7LDXJLLX4SHV5ANCNFSM6AAAAAA5J6HYZU>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
it may be worth adding something to the testing docs (post V8) to show how to mock out the ResiliencePipelineProvider as I can see people wanting to do this particularly when they are migrating from using the registry interfaces.
it may be worth adding something to the testing docs (post V8) to show how to mock out the ResiliencePipelineProvider as I can see people wanting to do this particularly when they are migrating from using the registry interfaces.
Essentially, what I’m now doing is moving all uses of the IPolicyRegistry (and derived interfaces) to the new pipeline implementation.
This is definitely doable, but I wonder whether it would be worth adding something to the docs to show how this is done (if it doesn’t already exist) and how to use these new base classes in testing.
From: peter-csala ***@***.***>
Sent: Thursday, September 28, 2023 10:18 AM
To: App-vNext/Polly ***@***.***>
Cc: Sean Farrow ***@***.***>; Mention ***@***.***>
Subject: Re: [App-vNext/Polly] Provide an interface for the ResiliencePipelineProvider (Issue #1652)
it may be worth adding something to the testing docs (post V8) to show how to mock out the ResiliencePipelineProvider as I can see people wanting to do this particularly when they are migrating from using the registry interfaces.
@martintmk<https://github.com/martintmk> @peter-csala<https://github.com/peter-csala> Thoughts on the above?
Hey @SeanFarrow<https://github.com/SeanFarrow> could you please share with us the related V7 code that you would like to migrate/port to V8?
So, basically we would like to understand what exactly do you want to achieve with the new API.
—
Reply to this email directly, view it on GitHub<#1652 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALDK7X2AWXIRICHKLUWFDDX4U6C3ANCNFSM6AAAAAA5J6HYZU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
This is definitely doable, but I wonder whether it would be worth adding something to the docs to show how this is done (if it doesn’t already exist) and how to use these new base classes in testing.
I think so. Mocking the ResiliencePipelineProvider is something that should be encouraged. I'll prepare some docs.
Activity
martincostello commentedon Sep 27, 2023
Have you taken a look at our new Polly v8 documentation for testing?
Does that and/or the Polly.Testing package help with what you're trying to achieve?
We're hours away from shipping Polly 8.0.0 and are basically code complete at this point, so I'm not sure at this point we'd delay to go through API review to consider adding new interfaces (we've avoided new interfaces for most (all?) of the new API surface).
There shouldn't be anything in the current design that prevents you from using DI and injecting things, they're just abstract classes instead of interfaces, and we have the empty builder you can use that is the successor to a no-op policy.
SeanFarrow commentedon Sep 27, 2023
martincostello commentedon Sep 28, 2023
@martintmk @peter-csala Thoughts on the above?
peter-csala commentedon Sep 28, 2023
Hey @SeanFarrow could you please share with us the related V7 code that you would like to migrate/port to V8?
So, basically we would like to understand what exactly do you want to achieve with the new API.
SeanFarrow commentedon Sep 28, 2023
martintmk commentedon Sep 29, 2023
I think so. Mocking the
ResiliencePipelineProvideris something that should be encouraged. I'll prepare some docs.