Skip to content

Class BackoffRule

Definition

Namespace: StardewUI.Framework
Assembly: StardewUI.dll

Defines the rules for exponential backoff.

public class BackoffRule

Inheritance
Object ⇦ BackoffRule

Members

Constructors

Name Description
BackoffRule(TimeSpan, TimeSpan, Single) Defines the rules for exponential backoff.

Fields

Name Description
Default Standard backoff rule deemed suitable for most types of UI retries.

Properties

Name Description
InitialDuration Gets the duration to wait before the first retry attempt.

Methods

Name Description
GetNextDuration(TimeSpan) Gets the duration to wait before the next retry attempt.

Details

Constructors

BackoffRule(TimeSpan, TimeSpan, float)

Defines the rules for exponential backoff.

public BackoffRule(System.TimeSpan initialDuration, System.TimeSpan maxDuration, float multiplier);
Parameters

initialDuration   TimeSpan
Duration to wait before the first retry attempt.

maxDuration   TimeSpan
Maximum duration to wait before any retry attempt; i.e. no matter how many retries have already occurred for a given key, it will not extend the duration any longer than this.

multiplier   Single
Amount to multiply the current duration on each subsequent retry, starting from initialDuration and going no higher than maxDuration.


Fields

Default

Standard backoff rule deemed suitable for most types of UI retries.

public static readonly StardewUI.Framework.BackoffRule Default;
Field Value

BackoffRule

Remarks

Uses an initial delay of 50 ms, maximum delay of 5 s, and multiplier of 4.


Properties

InitialDuration

Gets the duration to wait before the first retry attempt.

public System.TimeSpan InitialDuration { get; }
Property Value

TimeSpan


Methods

GetNextDuration(TimeSpan)

Gets the duration to wait before the next retry attempt.

public System.TimeSpan GetNextDuration(System.TimeSpan previousDuration);
Parameters

previousDuration   TimeSpan
The wait duration that was used on the previous attempt.

Returns

TimeSpan