TaskExecution<T>
Represents a single hedging attempt execution alongside all the necessary resources. These are:
Distinct ResilienceContext instance for this execution.
One exception are primary task where the main context is reused.
The cancellation token associated with the execution.
Gets the task that represents the execution of the hedged task.
public TaskExecution(HedgingHandler<T> handler, CancellationTokenSourcePool cancellationTokenSourcePool, TimeProvider timeProvider, ResilienceStrategyTelemetry telemetry)
public ValueTask<bool> InitializeAsync<TState>(HedgedTaskType type, ContextSnapshot snapshot, Func<ResilienceContext, TState, ValueTask<Outcome<T>>> primaryCallback, TState state, int attemptNumber)