Table of Contents

Class PipelineRetryPolicy<T>

Namespace
Pipelinez.Core.Retry
Assembly
Pipelinez.dll

Defines retry behavior for transient failures in segments or destinations.

public sealed class PipelineRetryPolicy<T> where T : PipelineRecord

Type Parameters

T

The pipeline record type processed by the policy.

Inheritance
PipelineRetryPolicy<T>
Inherited Members

Properties

DelayProvider

Gets the delegate used to calculate delay before the next attempt.

public Func<PipelineRetryContext<T>, TimeSpan> DelayProvider { get; }

Property Value

Func<PipelineRetryContext<T>, TimeSpan>

MaxAttempts

Gets the maximum number of attempts allowed by the policy.

public int MaxAttempts { get; }

Property Value

int

Methods

ExponentialBackoff(int, TimeSpan, TimeSpan, bool)

Creates an exponential backoff retry policy.

public static PipelineRetryPolicy<T> ExponentialBackoff(int maxAttempts, TimeSpan initialDelay, TimeSpan maxDelay, bool useJitter = false)

Parameters

maxAttempts int

The total number of attempts, including the initial attempt.

initialDelay TimeSpan

The delay used before the first retry attempt.

maxDelay TimeSpan

The maximum delay allowed between attempts.

useJitter bool

A value indicating whether randomized jitter should be applied.

Returns

PipelineRetryPolicy<T>

An exponential backoff retry policy.

FixedDelay(int, TimeSpan)

Creates a fixed-delay retry policy.

public static PipelineRetryPolicy<T> FixedDelay(int maxAttempts, TimeSpan delay)

Parameters

maxAttempts int

The total number of attempts, including the initial attempt.

delay TimeSpan

The delay applied between attempts.

Returns

PipelineRetryPolicy<T>

A fixed-delay retry policy.

Handle(Func<PipelineRetryContext<T>, bool>)

Restricts retries using a custom predicate.

public PipelineRetryPolicy<T> Handle(Func<PipelineRetryContext<T>, bool> predicate)

Parameters

predicate Func<PipelineRetryContext<T>, bool>

The predicate used to determine whether a retry is allowed.

Returns

PipelineRetryPolicy<T>

A new retry policy with the additional filter applied.

Handle<TException>()

Restricts retries to exceptions of the specified type.

public PipelineRetryPolicy<T> Handle<TException>() where TException : Exception

Returns

PipelineRetryPolicy<T>

A new retry policy with the additional filter applied.

Type Parameters

TException

The exception type that should be retried.

None()

Creates a policy that performs no retries beyond the initial attempt.

public static PipelineRetryPolicy<T> None()

Returns

PipelineRetryPolicy<T>

A retry policy with no retry behavior.