Table of Contents

Struct BackoffParameters

Namespace
Excalibur.Dispatch.Resilience
Assembly
Excalibur.Dispatch.dll

Immutable parameter set describing an exponential backoff schedule.

public readonly record struct BackoffParameters : IEquatable<BackoffParameters>
Implements
Inherited Members
Extension Methods

Remarks

This value carries the inputs consumed by Calculate(int, in BackoffParameters). It is a lightweight, allocation-free readonly record struct intended to be constructed at a call site (typically mapped from transport-specific retry options) and passed by in reference to the stateless calculator.

The delay produced is exactly min(BaseDelay * Multiplier^(attempt-1), MaxDelay).

This type names the growth law and nothing else. It previously carried a UseJitter flag and a JitterFactor, which made randomisation selectable from a value type and gave this package a second jitter implementation with a different distribution from the calculator's. Randomness is now chosen by WHICH CALCULATOR YOU CONSTRUCT -- see BackoffCalculatorFactory -- so a jitter band has no spelling on the public surface rather than merely being discouraged.

Properties

BaseDelay

Gets the base delay used for the first retry attempt.

public TimeSpan BaseDelay { get; init; }

Property Value

TimeSpan

The delay applied before the exponential multiplier is raised to a power.

MaxDelay

Gets the maximum delay cap. Computed delays are never larger than this value.

public TimeSpan MaxDelay { get; init; }

Property Value

TimeSpan

The upper bound on the produced delay.

Multiplier

Gets the multiplier governing exponential growth between attempts (typically 2.0).

public double Multiplier { get; init; }

Property Value

double

The exponential base; values below 1.0 are clamped up to 1.0 by the calculator.