<PackageReference Include="Polly.Core" Version="8.0.0-alpha.3" />

ResilienceStrategyRegistry<TKey>

public sealed class ResilienceStrategyRegistry<TKey> : ResilienceStrategyProvider<TKey>
Represents a registry of resilience strategies and builders that are accessible by TKey.

Initializes a new instance of the ResilienceStrategyRegistry<T> class with the default comparer.

Initializes a new instance of the ResilienceStrategyRegistry<T> class with a custom builder factory and comparer.

public void ClearStrategies()

Clears all cached strategies.

public void ClearStrategies<TResult>()

Clears all cached generic strategies.

public bool RemoveBuilder(TKey key)

Removes a resilience strategy builder from the registry.

public bool RemoveBuilder<TResult>(TKey key)

Removes a generic resilience strategy builder from the registry.

public bool RemoveStrategy(TKey key)

Removes a resilience strategy from the registry.

public bool RemoveStrategy<TResult>(TKey key)

Removes a generic resilience strategy from the registry.

public bool TryAddBuilder(TKey key, Action<ResilienceStrategyBuilder, ConfigureBuilderContext<TKey>> configure)

Tries to add a resilience strategy builder to the registry.

public bool TryAddBuilder<TResult>(TKey key, Action<ResilienceStrategyBuilder<TResult>, ConfigureBuilderContext<TKey>> configure)

Tries to add a generic resilience strategy builder to the registry.

public bool TryAddStrategy(TKey key, ResilienceStrategy strategy)

Tries to add an existing resilience strategy to the registry.

public bool TryAddStrategy<TResult>(TKey key, ResilienceStrategy<TResult> strategy)

Tries to add an existing generic resilience strategy to the registry.