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

ResiliencePipeline<T>

public sealed class ResiliencePipeline<T>
Resilience pipeline is used to execute the user-provided callbacks.
public static readonly ResiliencePipeline<T> Empty

Resilience pipeline that executes the user-provided callback without any additional logic.

public TResult Execute<TResult, TState>(Func<ResilienceContext, TState, TResult> callback, ResilienceContext context, TState state) where TResult : T

Executes the specified callback.

public TResult Execute<TResult>(Func<ResilienceContext, TResult> callback, ResilienceContext context) where TResult : T

Executes the specified callback.

public TResult Execute<TResult>(Func<CancellationToken, TResult> callback, CancellationToken cancellationToken = default) where TResult : T

Executes the specified callback.

public TResult Execute<TResult>(Func<TResult> callback) where TResult : T

Executes the specified callback.

public TResult Execute<TResult, TState>(Func<TState, TResult> callback, TState state) where TResult : T

Executes the specified callback.

public TResult Execute<TResult, TState>(Func<TState, CancellationToken, TResult> callback, TState state, CancellationToken cancellationToken = default) where TResult : T

Executes the specified callback.

public ValueTask<TResult> ExecuteAsync<TResult, TState>(Func<ResilienceContext, TState, ValueTask<TResult>> callback, ResilienceContext context, TState state) where TResult : T

Executes the specified callback.

public ValueTask<TResult> ExecuteAsync<TResult>(Func<ResilienceContext, ValueTask<TResult>> callback, ResilienceContext context) where TResult : T

Executes the specified callback.

public ValueTask<TResult> ExecuteAsync<TResult, TState>(Func<TState, CancellationToken, ValueTask<TResult>> callback, TState state, CancellationToken cancellationToken = default) where TResult : T

Executes the specified callback.

public ValueTask<TResult> ExecuteAsync<TResult>(Func<CancellationToken, ValueTask<TResult>> callback, CancellationToken cancellationToken = default) where TResult : T

Executes the specified callback.

public ValueTask<Outcome<TResult>> ExecuteOutcomeAsync<TResult, TState>(Func<ResilienceContext, TState, ValueTask<Outcome<TResult>>> callback, ResilienceContext context, TState state) where TResult : T

Executes the specified outcome-based callback.