Table of Contents

WithFunc Method

Definition

Namespace
Cuemon.Resilience
Assemblies
Cuemon.Resilience.dll
Source
src/Cuemon.Resilience/TransientOperation.cs

WithFunc<TResult>(Func<TResult>, Action<TransientOperationOptions>)

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.

public static TResult WithFunc<TResult>(Func<TResult> faultSensitiveMethod, Action<TransientOperationOptions> setup = null)

Parameters

faultSensitiveMethod Func<TResult>

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.

setup Action<TransientOperationOptions>

The TransientOperationOptions which may be configured.

Returns

TResult

The result from the faultSensitiveMethod.

Type Parameters

TResult

The type of the return value of faultSensitiveMethod.

Exceptions

ArgumentNullException

faultSensitiveMethod cannot be null.

LatencyException

The faultSensitiveMethod exceeded the maximum time allowed to network latency.

AggregateException

The faultSensitiveMethod was a victim of a transient fault. The InnerExceptions collection contains a TransientFaultException object.

-or

An exception was thrown during the invocation of the faultSensitiveMethod. The InnerExceptions collection contains information about the exception or exceptions.

WithFunc<T, TResult>(Func<T, TResult>, T, Action<TransientOperationOptions>)

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.

public static TResult WithFunc<T, TResult>(Func<T, TResult> faultSensitiveMethod, T arg, Action<TransientOperationOptions> setup = null)

Parameters

faultSensitiveMethod Func<T, TResult>

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.

arg T

The parameter of the function delegate faultSensitiveMethod.

setup Action<TransientOperationOptions>

The TransientOperationOptions which may be configured.

Returns

TResult

The result from the faultSensitiveMethod.

Type Parameters

T

The type of the parameter of the function delegate faultSensitiveMethod.

TResult

The type of the return value of the function delegate faultSensitiveMethod.

Exceptions

ArgumentNullException

faultSensitiveMethod cannot be null.

LatencyException

The faultSensitiveMethod exceeded the maximum time allowed to network latency.

AggregateException

The faultSensitiveMethod was a victim of a transient fault. The InnerExceptions collection contains a TransientFaultException object.

-or

An exception was thrown during the invocation of the faultSensitiveMethod. The InnerExceptions collection contains information about the exception or exceptions.

WithFunc<T1, T2, TResult>(Func<T1, T2, TResult>, T1, T2, Action<TransientOperationOptions>)

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.

public static TResult WithFunc<T1, T2, TResult>(Func<T1, T2, TResult> faultSensitiveMethod, T1 arg1, T2 arg2, Action<TransientOperationOptions> setup = null)

Parameters

faultSensitiveMethod Func<T1, T2, TResult>

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 T1

The first parameter of the function delegate faultSensitiveMethod.

arg2 T2

The second parameter of the function delegate faultSensitiveMethod.

setup Action<TransientOperationOptions>

The TransientOperationOptions which may be configured.

Returns

TResult

The result from the 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 return value of the function delegate faultSensitiveMethod.

Exceptions

ArgumentNullException

faultSensitiveMethod cannot be null.

LatencyException

The faultSensitiveMethod exceeded the maximum time allowed to network latency.

AggregateException

The faultSensitiveMethod was a victim of a transient fault. The InnerExceptions collection contains a TransientFaultException object.

-or

An exception was thrown during the invocation of the faultSensitiveMethod. The InnerExceptions collection contains information about the exception or exceptions.

WithFunc<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult>, T1, T2, T3, Action<TransientOperationOptions>)

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.

public static TResult WithFunc<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult> faultSensitiveMethod, T1 arg1, T2 arg2, T3 arg3, Action<TransientOperationOptions> setup = null)

Parameters

faultSensitiveMethod Func<T1, T2, T3, TResult>

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 T1

The first parameter of the function delegate faultSensitiveMethod.

arg2 T2

The second parameter of the function delegate faultSensitiveMethod.

arg3 T3

The third parameter of the function delegate faultSensitiveMethod.

setup Action<TransientOperationOptions>

The TransientOperationOptions which may be configured.

Returns

TResult

The result from the 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.

T3

The type of the third parameter of the function delegate faultSensitiveMethod.

TResult

The type of the return value of the function delegate faultSensitiveMethod.

Exceptions

ArgumentNullException

faultSensitiveMethod cannot be null.

LatencyException

The faultSensitiveMethod exceeded the maximum time allowed to network latency.

AggregateException

The faultSensitiveMethod was a victim of a transient fault. The InnerExceptions collection contains a TransientFaultException object.

-or

An exception was thrown during the invocation of the faultSensitiveMethod. The InnerExceptions collection contains information about the exception or exceptions.

WithFunc<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult>, T1, T2, T3, T4, Action<TransientOperationOptions>)

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.

public static TResult WithFunc<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult> faultSensitiveMethod, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Action<TransientOperationOptions> setup = null)

Parameters

faultSensitiveMethod Func<T1, T2, T3, T4, TResult>

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 T1

The first parameter of the function delegate faultSensitiveMethod.

arg2 T2

The second parameter of the function delegate faultSensitiveMethod.

arg3 T3

The third parameter of the function delegate faultSensitiveMethod.

arg4 T4

The fourth parameter of the function delegate faultSensitiveMethod.

setup Action<TransientOperationOptions>

The TransientOperationOptions which may be configured.

Returns

TResult

The result from the 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.

T3

The type of the third parameter of the function delegate faultSensitiveMethod.

T4

The type of the fourth parameter of the function delegate faultSensitiveMethod.

TResult

The type of the return value of the function delegate faultSensitiveMethod.

Exceptions

ArgumentNullException

faultSensitiveMethod cannot be null.

LatencyException

The faultSensitiveMethod exceeded the maximum time allowed to network latency.

AggregateException

The faultSensitiveMethod was a victim of a transient fault. The InnerExceptions collection contains a TransientFaultException object.

-or

An exception was thrown during the invocation of the faultSensitiveMethod. The InnerExceptions collection contains information about the exception or exceptions.

WithFunc<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5, Action<TransientOperationOptions>)

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.

public static TResult WithFunc<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult> faultSensitiveMethod, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Action<TransientOperationOptions> setup = null)

Parameters

faultSensitiveMethod Func<T1, T2, T3, T4, T5, TResult>

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 T1

The first parameter of the function delegate faultSensitiveMethod.

arg2 T2

The second parameter of the function delegate faultSensitiveMethod.

arg3 T3

The third parameter of the function delegate faultSensitiveMethod.

arg4 T4

The fourth parameter of the function delegate faultSensitiveMethod.

arg5 T5

The fifth parameter of the function delegate faultSensitiveMethod.

setup Action<TransientOperationOptions>

The TransientOperationOptions which may be configured.

Returns

TResult

The result from the 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.

T3

The type of the third parameter of the function delegate faultSensitiveMethod.

T4

The type of the fourth parameter of the function delegate faultSensitiveMethod.

T5

The type of the fifth parameter of the function delegate faultSensitiveMethod.

TResult

The type of the return value of the function delegate faultSensitiveMethod.

Exceptions

ArgumentNullException

faultSensitiveMethod cannot be null.

LatencyException

The faultSensitiveMethod exceeded the maximum time allowed to network latency.

AggregateException

The faultSensitiveMethod was a victim of a transient fault. The InnerExceptions collection contains a TransientFaultException object.

-or

An exception was thrown during the invocation of the faultSensitiveMethod. The InnerExceptions collection contains information about the exception or exceptions.