ResilienceHttpClientBuilderExtensions.AddResilienceHandler 方法

定义

重载

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>,ResilienceHandlerContext>)

添加使用命名内联复原管道的复原管道处理程序。

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>>)

添加使用命名内联复原管道的复原管道处理程序。

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>,ResilienceHandlerContext>)

Source:
ResilienceHttpClientBuilderExtensions.Resilience.cs

添加使用命名内联复原管道的复原管道处理程序。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Http::Resilience::IHttpResiliencePipelineBuilder ^ AddResilienceHandler(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::String ^ pipelineName, Action<Polly::ResiliencePipelineBuilder<System::Net::Http::HttpResponseMessage ^> ^, Microsoft::Extensions::Http::Resilience::ResilienceHandlerContext ^> ^ configure);
public static Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder AddResilienceHandler (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, string pipelineName, Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>,Microsoft.Extensions.Http.Resilience.ResilienceHandlerContext> configure);
static member AddResilienceHandler : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * string * Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>, Microsoft.Extensions.Http.Resilience.ResilienceHandlerContext> -> Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder
<Extension()>
Public Function AddResilienceHandler (builder As IHttpClientBuilder, pipelineName As String, configure As Action(Of ResiliencePipelineBuilder(Of HttpResponseMessage), ResilienceHandlerContext)) As IHttpResiliencePipelineBuilder

参数

builder
IHttpClientBuilder

生成器实例。

pipelineName
String

在管道名称中使用的复原管道的自定义标识符。

返回

builder 的值。

注解

最终管道名称是 和 pipelineName的组合Name。 如果 HTTP 客户端包含多个复原处理程序,请使用管道名称标识符。

适用于

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>>)

Source:
ResilienceHttpClientBuilderExtensions.Resilience.cs

添加使用命名内联复原管道的复原管道处理程序。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Http::Resilience::IHttpResiliencePipelineBuilder ^ AddResilienceHandler(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::String ^ pipelineName, Action<Polly::ResiliencePipelineBuilder<System::Net::Http::HttpResponseMessage ^> ^> ^ configure);
public static Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder AddResilienceHandler (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, string pipelineName, Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>> configure);
static member AddResilienceHandler : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * string * Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>> -> Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder
<Extension()>
Public Function AddResilienceHandler (builder As IHttpClientBuilder, pipelineName As String, configure As Action(Of ResiliencePipelineBuilder(Of HttpResponseMessage))) As IHttpResiliencePipelineBuilder

参数

builder
IHttpClientBuilder

生成器实例。

pipelineName
String

在管道名称中使用的复原管道的自定义标识符。

configure
Action<ResiliencePipelineBuilder<HttpResponseMessage>>

配置管道的回调。

返回

builder 的值。

注解

最终管道名称是 和 pipelineName的组合Name。 如果 HTTP 客户端包含多个复原处理程序,请使用管道名称标识符。

适用于