Struct OnRetryArguments<TResult>
Represents the arguments used by OnRetry for handling the retry event.
public readonly struct OnRetryArguments<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
OnRetryArguments(ResilienceContext, Outcome<TResult>, int, TimeSpan, TimeSpan)
Initializes a new instance of the OnRetryArguments<TResult> struct.
public OnRetryArguments(ResilienceContext context, Outcome<TResult> outcome, int attemptNumber, TimeSpan retryDelay, 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 attempt number.
retryDelay
TimeSpanThe delay before the next retry.
duration
TimeSpanThe duration of this attempt.
Properties
AttemptNumber
Gets the zero-based attempt number.
public int AttemptNumber { get; }
Property Value
Context
Gets the context of this event.
public ResilienceContext Context { get; }
Property Value
Duration
Gets the duration of this attempt.
public TimeSpan Duration { get; }
Property Value
Outcome
Gets the outcome that will be retried.
public Outcome<TResult> Outcome { get; }
Property Value
- Outcome<TResult>
RetryDelay
Gets the delay before the next retry.
public TimeSpan RetryDelay { get; }