Cuemon .NET Framework
TryExecuteFunction<T1,T2,TResult,TSuccess>(Int32,Doer<Int32,TimeSpan>,Doer<Exception,Boolean>,TesterDoer<T1,T2,TResult,TSuccess>,T1,T2,TResult) Method

The type of the first parameter of the function delegate faultSensitiveMethod.
The type of the second parameter of the function delegate faultSensitiveMethod.
The type of the out result value of the function delegate encapsulates faultSensitiveMethod.
The type of the return value that indicates success of the function delegate faultSensitiveMethod.
The amount of retry attempts for transient faults.
The function delegate that returns a System.TimeSpan specifying the amount of time to wait for a transient fault to recover gracefully before trying a new attempt.
The function delegate that returns true if the failed operations contains clues that would suggest a transient fault; otherwise, false.
The fault sensitive function delegate that is invoked until an operation is successful, the amount of retry attempts has been reached, or a failed operation is not considered related to transient fault condition.
The first parameter of the function delegate faultSensitiveMethod.
The second parameter of the function delegate faultSensitiveMethod.
The result of the function delegate faultSensitiveMethod.
Repetitively executes the specified faultSensitiveMethod until the operation is successful, the amount of retry attempts has been reached, or a failed operation is not considered related to transient fault condition.
Syntax
'Declaration
 
Public Overloads Shared Function TryExecuteFunction
    (Of T1,T2,TResult,TSuccess)( _
   ByVal retryAttempts As Integer, _
   ByVal recoveryWaitTime As Cuemon.Doer(Of Integer,TimeSpan), _
   ByVal isTransientFault As Cuemon.Doer(Of Exception,Boolean), _
   ByVal faultSensitiveMethod As Cuemon.TesterDoer(Of T1,T2,TResult,TSuccess), _
   ByVal arg1 As T1, _
   ByVal arg2 As T2, _
   ByRef result As TResult _
) As TSuccess
public static TSuccess TryExecuteFunction<T1,T2,TResult,TSuccess>( 
   int retryAttempts,
   Cuemon.Doer<int,TimeSpan> recoveryWaitTime,
   Cuemon.Doer<Exception,bool> isTransientFault,
   Cuemon.TesterDoer<T1,T2,TResult,TSuccess> faultSensitiveMethod,
   T1 arg1,
   T2 arg2,
   out TResult result
)

Parameters

retryAttempts
The amount of retry attempts for transient faults.
recoveryWaitTime
The function delegate that returns a System.TimeSpan specifying the amount of time to wait for a transient fault to recover gracefully before trying a new attempt.
isTransientFault
The function delegate that returns true if the failed operations contains clues that would suggest a transient fault; otherwise, false.
faultSensitiveMethod
The fault sensitive function delegate that is invoked until an operation is successful, the amount of retry attempts has been reached, or a failed operation is not considered related to transient fault condition.
arg1
The first parameter of the function delegate faultSensitiveMethod.
arg2
The second parameter of the function delegate faultSensitiveMethod.
result
The result of the function delegate faultSensitiveMethod.

Type Parameters

T1
The type of the first parameter of the function delegate faultSensitiveMethod.
T2
The type of the second parameter of the function delegate faultSensitiveMethod.
TResult
The type of the out result value of the function delegate encapsulates faultSensitiveMethod.
TSuccess
The type of the return value that indicates success of the function delegate faultSensitiveMethod.

Return Value

The return value that indicates success of the function delegate faultSensitiveMethod.
Requirements

Target Platforms: Windows 8, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

TransientFaultUtility Class
TransientFaultUtility Members
Overload List

 

 


| Cuemon is licensed under a The MIT License (MIT)



© 2009-2015 Weubphoria. All Rights Reserved.

Documentation made easy with Document! X by Innovasys

Send Feedback