<PackageReference Include="Polly.Core" Version="8.0.0" />

TaskExecution<T>

sealed class 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.
public int AttemptNumber { get; }

public ResilienceContext Context { get; }

public Task ExecutionTaskSafe { get; }

Gets the task that represents the execution of the hedged task.

public TimeSpan ExecutionTime { get; }

public bool IsAccepted { get; }

public bool IsHandled { get; }

public Action<TaskExecution<T>> OnReset { get; set; }

public Outcome<T> Outcome { get; }

public HedgedTaskType Type { get; set; }

public TaskExecution(HedgingHandler<T> handler, CancellationTokenSourcePool cancellationTokenSourcePool, TimeProvider timeProvider, ResilienceStrategyTelemetry telemetry)

public void AcceptOutcome()

public void Cancel()

public ValueTask<bool> InitializeAsync<TState>(HedgedTaskType type, ContextSnapshot snapshot, Func<ResilienceContext, TState, ValueTask<Outcome<T>>> primaryCallback, TState state, int attemptNumber)