HttpClientResiliencePredicates.IsTransient 方法

定义

重载

IsTransient(Outcome<HttpResponseMessage>)

确定复原策略是否应将结果视为暂时性故障。

IsTransient(Outcome<HttpResponseMessage>, CancellationToken)

确定复原策略是否 HttpResponseMessage 应将 视为暂时性故障。

IsTransient(Outcome<HttpResponseMessage>)

Source:
HttpClientResiliencePredicates.cs
Source:
HttpClientResiliencePredicates.cs

确定复原策略是否应将结果视为暂时性故障。

public:
 static bool IsTransient(Polly::Outcome<System::Net::Http::HttpResponseMessage ^> outcome);
public static bool IsTransient (Polly.Outcome<System.Net.Http.HttpResponseMessage> outcome);
static member IsTransient : Polly.Outcome<System.Net.Http.HttpResponseMessage> -> bool
Public Shared Function IsTransient (outcome As Outcome(Of HttpResponseMessage)) As Boolean

参数

outcome
Polly.Outcome<HttpResponseMessage>

返回

true 如果结果为暂时性, false 则为 ;否则为 。

适用于

IsTransient(Outcome<HttpResponseMessage>, CancellationToken)

Source:
HttpClientResiliencePredicates.cs

确定复原策略是否 HttpResponseMessage 应将 视为暂时性故障。

public:
 static bool IsTransient(Polly::Outcome<System::Net::Http::HttpResponseMessage ^> outcome, System::Threading::CancellationToken cancellationToken);
public static bool IsTransient (Polly.Outcome<System.Net.Http.HttpResponseMessage> outcome, System.Threading.CancellationToken cancellationToken);
[System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public static bool IsTransient (Polly.Outcome<System.Net.Http.HttpResponseMessage> outcome, System.Threading.CancellationToken cancellationToken);
static member IsTransient : Polly.Outcome<System.Net.Http.HttpResponseMessage> * System.Threading.CancellationToken -> bool
[<System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
static member IsTransient : Polly.Outcome<System.Net.Http.HttpResponseMessage> * System.Threading.CancellationToken -> bool
Public Shared Function IsTransient (outcome As Outcome(Of HttpResponseMessage), cancellationToken As CancellationToken) As Boolean

参数

outcome
Polly.Outcome<HttpResponseMessage>

用户指定的回调的结果。

cancellationToken
CancellationToken

CancellationToken与执行关联的 。

返回

true 如果结果为暂时性, false 则为 ;否则为 。

属性

适用于