C# 宝洁;P RetryPolicy,什么是暂时异常
我尝试使用Microsoft.WindowsAzure.StorageClient.RetryPolicy;没有连接到Azure服务C# 宝洁;P RetryPolicy,什么是暂时异常,c#,.net,azure,C#,.net,Azure,我尝试使用Microsoft.WindowsAzure.StorageClient.RetryPolicy;没有连接到Azure服务 var _retry = RetryPolicyFactory.GetRetryPolicy<StorageTransientErrorDetectionStrategy>("Incremental Retry Strategy"); var result = _retry.ExecuteAction(()=> InnerRequest(da
var _retry = RetryPolicyFactory.GetRetryPolicy<StorageTransientErrorDetectionStrategy>("Incremental Retry Strategy");
var result = _retry.ExecuteAction(()=> InnerRequest(data));
var\u retry=RetryPolicyFactory.GetRetryPolicy(“增量重试策略”);
var result=_retry.ExecuteAction(()=>InnerRequest(数据));
问题是-InnerRequest方法应该做什么才能使RetryPolicy开始工作?
它应该抛出某种指定的异常?暂时性错误由Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling程序集中可用的错误检测策略自动检测(如代码段中的StorageTransientErrorDetectionStrategy),这将触发重试策略 实际上,这是基于Microsoft.Practices.TransientFaultHandling.Core程序集中的内容。Azure特定程序集中的每个错误检测策略都实现以下接口:
/// <summary>
/// Defines an interface which must be implemented by custom components responsible for detecting specific transient conditions.
/// </summary>
public interface ITransientErrorDetectionStrategy
{
/// <summary>
/// Determines whether the specified exception represents a transient failure that can be compensated by a retry.
/// </summary>
/// <param name="ex">The exception object to be verified.</param>
/// <returns>True if the specified exception is considered as transient, otherwise false.</returns>
bool IsTransient(Exception ex);
}
暂时性错误由Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling程序集中可用的错误检测策略自动检测(如代码段中的StorageTransientErrorDetectionStrategy),这将触发重试策略 实际上,这是基于Microsoft.Practices.TransientFaultHandling.Core程序集中的内容。Azure特定程序集中的每个错误检测策略都实现以下接口:
/// <summary>
/// Defines an interface which must be implemented by custom components responsible for detecting specific transient conditions.
/// </summary>
public interface ITransientErrorDetectionStrategy
{
/// <summary>
/// Determines whether the specified exception represents a transient failure that can be compensated by a retry.
/// </summary>
/// <param name="ex">The exception object to be verified.</param>
/// <returns>True if the specified exception is considered as transient, otherwise false.</returns>
bool IsTransient(Exception ex);
}