• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class RetryableAction

Allows an action to be run and retried after a delay when an exception is thrown. If the action never succeeds the final exception will be re-thrown for the caller to catch.

Inheritance
System.Object
RetryableAction
Namespace: DotNetNuke.Common.Utilities.Internal
Assembly: DotNetNuke.dll
Syntax
public class RetryableAction : object

Constructors

| Improve this Doc View Source

RetryableAction(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
| Improve this Doc View Source

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 Source

Action

Gets or sets the Action to execute.

Declaration
public Action Action { get; set; }
Property Value
Type Description
Action
| Improve this Doc View Source

Delay

Gets or sets the number of milliseconds to wait between retries. The delay period is approximate and will be affected by the demands of other threads on the system.

Declaration
public TimeSpan Delay { get; set; }
Property Value
Type Description
TimeSpan
| Improve this Doc View Source

DelayMultiplier

Gets or sets a factor by which the delay is adjusted after each retry. Default is 1. To double the delay with every retry use a factor of 2, retrys will be 1s, 2s, 4s, 8s... To quarter the delay with every retry use a factor of 0.25, retrys will be 1s, 0.25, 0.0625, 0.015625s...

Declaration
public float DelayMultiplier { get; set; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

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
| Improve this Doc View Source

MaxRetries

Gets or sets the maximum number of retries to attempt.

Declaration
public int MaxRetries { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

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 Source

Retry5TimesWith2SecondsDelay(Action, String)

Allows an action to be run and retried after a delay when an exception is thrown. If the action never succeeds the final exception will be re-thrown for the caller to catch.

Declaration
public static void Retry5TimesWith2SecondsDelay(Action action, string description)
Parameters
Type Name Description
Action action
System.String description
| Improve this Doc View Source

RetryEverySecondFor30Seconds(Action, String)

Allows an action to be run and retried after a delay when an exception is thrown. If the action never succeeds the final exception will be re-thrown for the caller to catch.

Declaration
public static void RetryEverySecondFor30Seconds(Action action, string description)
Parameters
Type Name Description
Action action
System.String description
| Improve this Doc View Source

TryIt()

Allows an action to be run and retried after a delay when an exception is thrown. If the action never succeeds the final exception will be re-thrown for the caller to catch.

Declaration
public void TryIt()

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS