Class RetryableAction
Allows an action to be run and retried after a delay when an exception is thrown.
Inheritance
Namespace: DotNetNuke.Common.Utilities.Internal
Assembly: DotNetNuke.dll
Syntax
public class RetryableAction : object
Constructors
| Improve this Doc View SourceRetryableAction(Action, String, Int32, TimeSpan, Single)
Initializes a new instance of the RetryableAction class.
Declaration
public RetryableAction(Action action, string description, int maxRetries, TimeSpan delay, float delayMultiplier)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | |
| System.String | description | |
| System.Int32 | maxRetries | |
| TimeSpan | delay | |
| System.Single | delayMultiplier |
RetryableAction(Action, String, Int32, TimeSpan)
Initializes a new instance of the RetryableAction class.
Declaration
public RetryableAction(Action action, string description, int maxRetries, TimeSpan delay)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | |
| System.String | description | |
| System.Int32 | maxRetries | |
| TimeSpan | delay |
Properties
| Improve this Doc View SourceAction
Gets or sets the Action to execute.
Declaration
public Action Action { get; set; }
Property Value
| Type | Description |
|---|---|
| Action |
Delay
Gets or sets the number of milliseconds to wait between retries.
Declaration
public TimeSpan Delay { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
DelayMultiplier
Gets or sets a factor by which the delay is adjusted after each retry. Default is 1.
Declaration
public float DelayMultiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Description
Gets or sets a message describing the action. The primary purpose is to make the action identifiable in the log output.
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
MaxRetries
Gets or sets the maximum number of retries to attempt.
Declaration
public int MaxRetries { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
SleepAction
Gets or sets method that allows thread to sleep until next retry meant for unit testing purposes.
Declaration
public static Action<int> SleepAction { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<System.Int32> |
Methods
| Improve this Doc View SourceRetry5TimesWith2SecondsDelay(Action, String)
Allows an action to be run and retried after a delay when an exception is thrown.
Declaration
public static void Retry5TimesWith2SecondsDelay(Action action, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | |
| System.String | description |
RetryEverySecondFor30Seconds(Action, String)
Allows an action to be run and retried after a delay when an exception is thrown.
Declaration
public static void RetryEverySecondFor30Seconds(Action action, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | |
| System.String | description |
TryIt()
Allows an action to be run and retried after a delay when an exception is thrown.
Declaration
public void TryIt()