Class TransientOperationOptions
Specifies options that is related to TransientOperation handling.
Inheritance
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public class TransientOperationOptions
Constructors
| Improve this DocTransientOperationOptions()
Initializes a new instance of the TransientOperationOptions class.
Declaration
public TransientOperationOptions()
Remarks
The following table shows the initial property values for an instance of TransientOperationOptions.
Property | Initial Value |
---|---|
RetryAttempts | DefaultRetryAttempts |
EnableRecovery | RetryAttempts > 0 |
RetryStrategy | retry + 2^ to a maximum of 5; eg. 1, 2, 4, 8, 16 to a total of 31 seconds |
DetectionStrategy | exception => false |
MaximumAllowedLatency | 5 minutes |
Properties
| Improve this DocDefaultRetryAttempts
Gets or sets the default amount of retry attempts for transient faults. Default is 5 attempts.
Declaration
public static byte DefaultRetryAttempts { get; set; }
Property Value
Type | Description |
---|---|
System.Byte | The default amount of retry attempts for transient faults. |
DetectionStrategy
Gets or sets the callback function delegate that determines if an System.Exception contains clues that would suggest a transient fault.
Declaration
public Func<Exception, bool> DetectionStrategy { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.Exception, System.Boolean> | A System.Func<TResult> that determines if an System.Exception contains clues that would suggest a transient fault. |
Remarks
Default implementation is fixed to none-transient failure.
EnableRecovery
Gets or sets a value indicating whether a transient operation should be attempted gracefully recovered in case of a transient fault or simply be invoked like a normal operation.
Declaration
public bool EnableRecovery { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
For testing or diagnostic purposes, it can sometimes come in handy to turn off transient fault recovery.
MaximumAllowedLatency
Gets or sets the maximum allowed latency before a LatencyException is raised.
Declaration
public TimeSpan MaximumAllowedLatency { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan | A System.TimeSpan defining the maximum allowed latency. |
RetryAttempts
Gets or sets the amount of retry attempts for transient faults. Default value is DefaultRetryAttempts.
Declaration
public int RetryAttempts { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The retry attempts for transient faults. |
RetryStrategy
Gets or sets the callback function delegate that determines the amount of time to wait for a transient fault to recover gracefully before trying a new attempt.
Declaration
public Func<int, TimeSpan> RetryStrategy { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.Int32, System.TimeSpan> | A System.Func<TResult> that determines the amount of time to wait for a transient fault to recover gracefully. |
Remarks
Default implementation is System.Int32 + 2^ to a maximum of 5; eg. 1, 2, 4, 8, 16 to a total of 32 seconds.