Class AddResiliencePipelineContext<TKey>
- Namespace
- Polly.DependencyInjection
- Assembly
- Polly.Extensions.dll
Represents the context for adding a resilience pipeline with the specified key.
public sealed class AddResiliencePipelineContext<TKey> where TKey : notnull
Type Parameters
TKey
The type of the key used to identify the resilience pipeline.
- Inheritance
-
AddResiliencePipelineContext<TKey>
- Inherited Members
Properties
PipelineKey
Gets the pipeline key for the pipeline being created.
public TKey PipelineKey { get; }
Property Value
- TKey
ServiceProvider
Gets the IServiceProvider that provides access to the dependency injection container.
public IServiceProvider ServiceProvider { get; }
Property Value
Methods
EnableReloads<TOptions>(string?)
Enables dynamic reloading of the resilience pipeline whenever the TOptions
options are changed.
public void EnableReloads<TOptions>(string? name = null)
Parameters
name
stringThe named options, if any.
Type Parameters
TOptions
The options type to listen to.
Remarks
You can decide based on the name
to listen for changes in global options or named options.
If name
is null then the global options are listened to.
You can listen for changes from multiple options by calling this method with different TOptions
types.
GetOptions<TOptions>(string?)
Gets the options identified by name
.
public TOptions GetOptions<TOptions>(string? name = null)
Parameters
name
stringThe options name, if any.
Returns
- TOptions
The options instance.
Type Parameters
TOptions
The options type.
Remarks
If name
is null then the global options are returned.
OnPipelineDisposed(Action)
Registers a callback that is called when the pipeline instance being configured is disposed.
public void OnPipelineDisposed(Action callback)
Parameters
callback
ActionThe callback delegate.