Bagikan melalui


ResilienceHttpClientBuilderExtensions.AddResilienceHandler Metode

Definisi

Overload

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

Menambahkan handler alur ketahanan yang menggunakan alur ketahanan sebaris bernama.

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

Menambahkan handler alur ketahanan yang menggunakan alur ketahanan sebaris bernama.

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

Sumber:
ResilienceHttpClientBuilderExtensions.Resilience.cs
Sumber:
ResilienceHttpClientBuilderExtensions.Resilience.cs

Menambahkan handler alur ketahanan yang menggunakan alur ketahanan sebaris bernama.

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

Parameter

builder
IHttpClientBuilder

Instans penyusun.

pipelineName
String

Pengidentifikasi kustom untuk alur ketahanan, digunakan dalam nama alur.

configure
Action<Polly.ResiliencePipelineBuilder<HttpResponseMessage>,ResilienceHandlerContext>

Panggilan balik yang mengonfigurasi alur.

Mengembalikan

Nilai dari builder.

Keterangan

Nama alur akhir adalah kombinasi dari Name dan pipelineName. Gunakan pengidentifikasi nama alur jika klien HTTP Anda berisi beberapa penangan ketahanan.

Berlaku untuk

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

Sumber:
ResilienceHttpClientBuilderExtensions.Resilience.cs
Sumber:
ResilienceHttpClientBuilderExtensions.Resilience.cs

Menambahkan handler alur ketahanan yang menggunakan alur ketahanan sebaris bernama.

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

Parameter

builder
IHttpClientBuilder

Instans penyusun.

pipelineName
String

Pengidentifikasi kustom untuk alur ketahanan, digunakan dalam nama alur.

configure
Action<Polly.ResiliencePipelineBuilder<HttpResponseMessage>>

Panggilan balik yang mengonfigurasi alur.

Mengembalikan

Nilai dari builder.

Keterangan

Nama alur akhir adalah kombinasi dari Name dan pipelineName. Gunakan pengidentifikasi nama alur jika klien HTTP Anda berisi beberapa penangan ketahanan.

Berlaku untuk