Table of Contents

Struct OnRetryArguments<TResult>

Namespace
Polly.Retry
Assembly
Polly.Core.dll

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 ResilienceContext

The outcome of the resilience operation or event.

outcome Outcome<TResult>

The context in which the resilience operation or event occurred.

attemptNumber int

The zero-based attempt number.

retryDelay TimeSpan

The delay before the next retry.

duration TimeSpan

The duration of this attempt.

Properties

AttemptNumber

Gets the zero-based attempt number.

public int AttemptNumber { get; }

Property Value

int

Context

Gets the context of this event.

public ResilienceContext Context { get; }

Property Value

ResilienceContext

Duration

Gets the duration of this attempt.

public TimeSpan Duration { get; }

Property Value

TimeSpan

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; }

Property Value

TimeSpan