-
Notifications
You must be signed in to change notification settings - Fork 870
[API Proposal]: HttpKey usage #7535
Description
Background and motivation
Re: Microsoft.Extensions.Http.Resilience, Microsoft.Extensions.DependencyInjection
So HttpKey is currently not a public API member. When registering resilience handlers on an IHttpClientBuilder using the AddResilienceHandler extension, it creates an HttpResiliencePipelineBuilder by calling AddHttpResiliencePipeline<HttpKey, HttpResponseMessage>.
AFAICT all documentation that deals with "advanced" scenarios, like executing a pipeline using ExecuteAsync with a given ResilienceContext, requires a ResiliencePipelineProvider or ResiliencePipelineRegistry with a key type of string. When using DI to request such a provider, it is not currently possible to reference a type of ResiliencePipelineProvider<HttpKey> because HttpKey is an internal type.
API Proposal
internal readonly record struct HttpKey(string Name, string InstanceName)
should be
public readonly record struct HttpKey(string Name, string InstanceName)
API Usage
ResiliencePipelineProvider<HttpKey> theRegisteredProvider,
Alternative Designs
Provide guidance on how to accomplish advanced scenarios when using AddResilienceHandler
Risks
No response