Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 宝洁;P RetryPolicy,什么是暂时异常_C#_.net_Azure - Fatal编程技术网

C# 宝洁;P RetryPolicy,什么是暂时异常

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

我尝试使用Microsoft.WindowsAzure.StorageClient.RetryPolicy;没有连接到Azure服务

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);
}