Struct OnHedgingArguments<TResult>
Represents arguments used by the on-hedging event.
public readonly struct OnHedgingArguments<TResult>
Type Parameters
TResult
The type of result.
- Inherited Members
Remarks
Always use the constructor when creating this struct, otherwise we do not guarantee binary compatibility.
Constructors
OnHedgingArguments(ResilienceContext, Outcome<TResult>?, int, TimeSpan)
Initializes a new instance of the OnHedgingArguments<TResult> struct.
public OnHedgingArguments(ResilienceContext context, Outcome<TResult>? outcome, int attemptNumber, TimeSpan duration)
Parameters
context
ResilienceContextThe outcome of the resilience operation or event.
outcome
Outcome<TResult>?The context in which the resilience operation or event occurred.
attemptNumber
intThe zero-based hedging attempt number.
duration
TimeSpanThe execution duration of hedging attempt or the hedging delay in case the attempt was not finished in time.
Properties
AttemptNumber
Gets the zero-based hedging attempt number.
public int AttemptNumber { get; }
Property Value
Context
Gets the context of this event.
public ResilienceContext Context { get; }
Property Value
Duration
Gets the execution duration of hedging attempt or the hedging delay in case the attempt was not finished in time.
public TimeSpan Duration { get; }
Property Value
Outcome
Gets the outcome that needs to be hedged, if any.
public Outcome<TResult>? Outcome { get; }
Property Value
- Outcome<TResult>?
Remarks
If this property is null, it's an indication that user-callback or hedged operation did not complete within the hedging delay.