Table of Contents

Class ResiliencePipelineProvider<TKey>

Namespace
Polly.Registry
Assembly
Polly.Core.dll

Represents a provider for resilience pipelines that are accessible by TKey.

public abstract class ResiliencePipelineProvider<TKey> where TKey : notnull

Type Parameters

TKey

The type of the key.

Inheritance
ResiliencePipelineProvider<TKey>
Derived
Inherited Members

Methods

GetPipeline(TKey)

Retrieves a resilience pipeline from the provider using the specified key.

public virtual ResiliencePipeline GetPipeline(TKey key)

Parameters

key TKey

The key used to identify the resilience pipeline.

Returns

ResiliencePipeline

The resilience pipeline associated with the specified key.

Exceptions

KeyNotFoundException

Thrown when no resilience pipeline is found for the specified key.

GetPipeline<TResult>(TKey)

Retrieves a generic resilience pipeline from the provider using the specified key.

public virtual ResiliencePipeline<TResult> GetPipeline<TResult>(TKey key)

Parameters

key TKey

The key used to identify the resilience pipeline.

Returns

ResiliencePipeline<TResult>

The resilience pipeline associated with the specified key.

Type Parameters

TResult

The type of result that the resilience pipeline handles.

Exceptions

KeyNotFoundException

Thrown when no resilience pipeline is found for the specified key.

TryGetPipeline(TKey, out ResiliencePipeline?)

Tries to get a resilience pipeline from the provider using the specified key.

public abstract bool TryGetPipeline(TKey key, out ResiliencePipeline? pipeline)

Parameters

key TKey

The key used to identify the resilience pipeline.

pipeline ResiliencePipeline

The output resilience pipeline if found, null otherwise.

Returns

bool

true if the pipeline was found, false otherwise.

TryGetPipeline<TResult>(TKey, out ResiliencePipeline<TResult>?)

Tries to get a generic resilience pipeline from the provider using the specified key.

public abstract bool TryGetPipeline<TResult>(TKey key, out ResiliencePipeline<TResult>? pipeline)

Parameters

key TKey

The key used to identify the resilience pipeline.

pipeline ResiliencePipeline<TResult>

The output resilience pipeline if found, null otherwise.

Returns

bool

true if the pipeline was found, false otherwise.

Type Parameters

TResult

The type of result that the resilience pipeline handles.