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
The PrimaryContext represents the context that was received by the hedging strategy and used to execute the primary action. To prevent race conditions, the hedging strategy then clones the primary context into ActionContext and uses it to execute the hedged action. Every hedged action gets its own context that is cloned from the primary.
Always use the constructor when creating this struct, otherwise we do not guarantee binary compatibility.
Constructors
OnHedgingArguments(ResilienceContext, ResilienceContext, int)
Initializes a new instance of the OnHedgingArguments<TResult> struct.
public OnHedgingArguments(ResilienceContext primaryContext, ResilienceContext actionContext, int attemptNumber)
Parameters
primaryContext
ResilienceContextThe primary context received by the hedging strategy.
actionContext
ResilienceContextThe action context. cloned from the primary context.
attemptNumber
intThe zero-based hedging attempt number.
Properties
ActionContext
Gets the action context that will be used for the hedged action.
public ResilienceContext ActionContext { get; }
Property Value
Remarks
This context is cloned from PrimaryContext.
AttemptNumber
Gets the zero-based hedging attempt number.
public int AttemptNumber { get; }
Property Value
PrimaryContext
Gets the primary resilience context as received by the hedging strategy.
public ResilienceContext PrimaryContext { get; }