Table of Contents

Class HedgingOptions

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

Configuration options for the hedging resilience policy.

public sealed class HedgingOptions
Inheritance
HedgingOptions
Inherited Members
Extension Methods

Remarks

Hedging sends parallel requests after a configured delay, returning the first successful result. This reduces tail latency at the cost of increased resource usage.

This follows the pattern from Polly v8's HedgingStrategyOptions.

Properties

Delay

Gets or sets the delay before launching each hedged attempt.

public TimeSpan Delay { get; set; }

Property Value

TimeSpan

The delay before launching a hedged request. Defaults to 2 seconds.

EnableDetailedLogging

Gets or sets a value indicating whether to enable detailed logging of hedging operations.

public bool EnableDetailedLogging { get; set; }

Property Value

bool

true to emit diagnostic log entries for hedging; otherwise, false. Defaults to true.

MaxHedgedAttempts

Gets or sets the maximum number of hedged attempts (excluding the primary request).

[Range(1, 10)]
public int MaxHedgedAttempts { get; set; }

Property Value

int

The maximum hedged attempts. Defaults to 2.

ShouldHedge

Gets or sets the predicate to determine which exceptions should trigger hedging.

public Func<Exception, bool>? ShouldHedge { get; set; }

Property Value

Func<Exception, bool>

A predicate that returns true for exceptions that should trigger hedging.