Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
martintmk committed Aug 17, 2023
1 parent a7de858 commit deba4ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Polly.Core/Registry/ResiliencePipelineProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public abstract class ResiliencePipelineProvider<TKey>
/// <param name="key">The key used to identify the resilience pipeline.</param>
/// <returns>The resilience pipeline associated with the specified key.</returns>
/// <exception cref="KeyNotFoundException">Thrown when no resilience pipeline is found for the specified key.</exception>
/// <exception cref="ObjectDisposedException">Thrown when the provider is already disposed.</exception>
public virtual ResiliencePipeline GetPipeline(TKey key)
{
if (TryGetPipeline(key, out var pipeline))
Expand All @@ -35,6 +36,7 @@ public virtual ResiliencePipeline GetPipeline(TKey key)
/// <param name="key">The key used to identify the resilience pipeline.</param>
/// <returns>The resilience pipeline associated with the specified key.</returns>
/// <exception cref="KeyNotFoundException">Thrown when no resilience pipeline is found for the specified key.</exception>
/// <exception cref="ObjectDisposedException">Thrown when the provider is already disposed.</exception>
public virtual ResiliencePipeline<TResult> GetPipeline<TResult>(TKey key)
{
if (TryGetPipeline<TResult>(key, out var pipeline))
Expand All @@ -52,6 +54,7 @@ public virtual ResiliencePipeline<TResult> GetPipeline<TResult>(TKey key)
/// <param name="key">The key used to identify the resilience pipeline.</param>
/// <param name="pipeline">The output resilience pipeline if found, <see langword="null"/> otherwise.</param>
/// <returns><see langword="true"/> if the pipeline was found, <see langword="false"/> otherwise.</returns>
/// <exception cref="ObjectDisposedException">Thrown when the provider is already disposed.</exception>
public abstract bool TryGetPipeline(TKey key, [NotNullWhen(true)] out ResiliencePipeline? pipeline);

/// <summary>
Expand All @@ -61,5 +64,6 @@ public virtual ResiliencePipeline<TResult> GetPipeline<TResult>(TKey key)
/// <param name="key">The key used to identify the resilience pipeline.</param>
/// <param name="pipeline">The output resilience pipeline if found, <see langword="null"/> otherwise.</param>
/// <returns><see langword="true"/> if the pipeline was found, <see langword="false"/> otherwise.</returns>
/// <exception cref="ObjectDisposedException">Thrown when the provider is already disposed.</exception>
public abstract bool TryGetPipeline<TResult>(TKey key, [NotNullWhen(true)] out ResiliencePipeline<TResult>? pipeline);
}
6 changes: 6 additions & 0 deletions src/Polly.Core/Registry/ResiliencePipelineRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public override bool TryGetPipeline(TKey key, [NotNullWhen(true)] out Resilience
/// <param name="key">The key used to identify the resilience pipeline.</param>
/// <param name="configure">The callback that configures the pipeline builder.</param>
/// <returns>An instance of pipeline.</returns>
/// <exception cref="ObjectDisposedException">Thrown when the registry is already disposed.</exception>
public ResiliencePipeline GetOrAddPipeline(TKey key, Action<ResiliencePipelineBuilder> configure)
{
Guard.NotNull(configure);
Expand All @@ -110,6 +111,7 @@ public ResiliencePipeline GetOrAddPipeline(TKey key, Action<ResiliencePipelineBu
/// <param name="key">The key used to identify the resilience pipeline.</param>
/// <param name="configure">The callback that configures the pipeline builder.</param>
/// <returns>An instance of pipeline.</returns>
/// <exception cref="ObjectDisposedException">Thrown when the registry is already disposed.</exception>
public ResiliencePipeline GetOrAddPipeline(TKey key, Action<ResiliencePipelineBuilder, ConfigureBuilderContext<TKey>> configure)
{
Guard.NotNull(configure);
Expand Down Expand Up @@ -141,6 +143,7 @@ public ResiliencePipeline GetOrAddPipeline(TKey key, Action<ResiliencePipelineBu
/// <param name="key">The key used to identify the resilience pipeline.</param>
/// <param name="configure">The callback that configures the pipeline builder.</param>
/// <returns>An instance of pipeline.</returns>
/// <exception cref="ObjectDisposedException">Thrown when the registry is already disposed.</exception>
public ResiliencePipeline<TResult> GetOrAddPipeline<TResult>(TKey key, Action<ResiliencePipelineBuilder<TResult>> configure)
{
Guard.NotNull(configure);
Expand All @@ -157,6 +160,7 @@ public ResiliencePipeline<TResult> GetOrAddPipeline<TResult>(TKey key, Action<Re
/// <param name="key">The key used to identify the resilience pipeline.</param>
/// <param name="configure">The callback that configures the pipeline builder.</param>
/// <returns>An instance of pipeline.</returns>
/// <exception cref="ObjectDisposedException">Thrown when the registry is already disposed.</exception>
public ResiliencePipeline<TResult> GetOrAddPipeline<TResult>(TKey key, Action<ResiliencePipelineBuilder<TResult>, ConfigureBuilderContext<TKey>> configure)
{
Guard.NotNull(configure);
Expand All @@ -176,6 +180,7 @@ public ResiliencePipeline<TResult> GetOrAddPipeline<TResult>(TKey key, Action<Re
/// Use this method when you want to create the pipeline on-demand when it's first accessed.
/// </remarks>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="configure"/> is <see langword="null"/>.</exception>
/// <exception cref="ObjectDisposedException">Thrown when the registry is already disposed.</exception>
public bool TryAddBuilder(TKey key, Action<ResiliencePipelineBuilder, ConfigureBuilderContext<TKey>> configure)
{
Guard.NotNull(configure);
Expand All @@ -196,6 +201,7 @@ public bool TryAddBuilder(TKey key, Action<ResiliencePipelineBuilder, ConfigureB
/// Use this method when you want to create the pipeline on-demand when it's first accessed.
/// </remarks>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="configure"/> is <see langword="null"/>.</exception>
/// <exception cref="ObjectDisposedException">Thrown when the registry is already disposed.</exception>
public bool TryAddBuilder<TResult>(TKey key, Action<ResiliencePipelineBuilder<TResult>, ConfigureBuilderContext<TKey>> configure)
{
Guard.NotNull(configure);
Expand Down

0 comments on commit deba4ce

Please sign in to comment.