Struct HedgingActionGeneratorArguments<TResult>
Represents arguments used in the hedging resilience strategy.
public readonly struct HedgingActionGeneratorArguments<TResult>
Type Parameters
TResult
The type of the result.
- Inherited Members
Remarks
Always use the constructor when creating this struct, otherwise we do not guarantee binary compatibility.
Constructors
HedgingActionGeneratorArguments(ResilienceContext, ResilienceContext, int, Func<ResilienceContext, ValueTask<Outcome<TResult>>>)
Initializes a new instance of the HedgingActionGeneratorArguments<TResult> struct.
public HedgingActionGeneratorArguments(ResilienceContext primaryContext, ResilienceContext actionContext, int attemptNumber, Func<ResilienceContext, ValueTask<Outcome<TResult>>> callback)
Parameters
primaryContext
ResilienceContextThe primary resilience context.
actionContext
ResilienceContextThe context that will be passed to action generated by ActionGenerator. .
attemptNumber
intThe zero-based hedging attempt number.
callback
Func<ResilienceContext, ValueTask<Outcome<TResult>>>The callback passed to hedging strategy.
Properties
ActionContext
Gets the context that will be passed to action generated by ActionGenerator.
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
Callback
Gets the callback passed to hedging strategy.
public Func<ResilienceContext, ValueTask<Outcome<TResult>>> Callback { get; }
Property Value
- Func<ResilienceContext, ValueTask<Outcome<TResult>>>
PrimaryContext
Gets the primary resilience context.
public ResilienceContext PrimaryContext { get; }