Skip to content

Commit

Permalink
Pool rename, api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeyertons committed Oct 16, 2023
1 parent 84b1f3d commit 2954abd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Polly.Core/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#nullable enable
Polly.ResiliencePipelineBuilderBase.Pool.get -> Polly.ResilienceContextPool?
Polly.ResiliencePipelineBuilderBase.Pool.set -> void
Polly.ResiliencePipelineBuilderBase.ResilienceContextPool.get -> Polly.ResilienceContextPool?
Polly.ResiliencePipelineBuilderBase.ResilienceContextPool.set -> void
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public ResiliencePipeline<TResult> GetOrAdd(TKey key, Action<ResiliencePipelineB
(var builder, var component) = componentBuilder.CreateComponent();
return new ResiliencePipeline<TResult>(component, DisposeBehavior.Reject, builder.Pool);
return new ResiliencePipeline<TResult>(component, DisposeBehavior.Reject, builder.ResilienceContextPool);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/Polly.Core/Registry/ResiliencePipelineRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public ResiliencePipeline GetOrAddPipeline(TKey key, Action<ResiliencePipelineBu
(var builder, var component) = componentBuilder.CreateComponent();
return new ResiliencePipeline(component, DisposeBehavior.Reject, builder.Pool);
return new ResiliencePipeline(component, DisposeBehavior.Reject, builder.ResilienceContextPool);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/Polly.Core/ResiliencePipelineBuilder.TResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ internal ResiliencePipelineBuilder(ResiliencePipelineBuilderBase other)
/// </summary>
/// <returns>An instance of <see cref="ResiliencePipeline{TResult}"/>.</returns>
/// <exception cref="ValidationException">Thrown when this builder has invalid configuration.</exception>
public ResiliencePipeline<TResult> Build() => new(BuildPipelineComponent(), DisposeBehavior.Allow, Pool);
public ResiliencePipeline<TResult> Build() => new(BuildPipelineComponent(), DisposeBehavior.Allow, ResilienceContextPool);
}
2 changes: 1 addition & 1 deletion src/Polly.Core/ResiliencePipelineBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ public sealed class ResiliencePipelineBuilder : ResiliencePipelineBuilderBase
/// </summary>
/// <returns>An instance of <see cref="ResiliencePipeline"/>.</returns>
/// <exception cref="ValidationException">Thrown when this builder has invalid configuration.</exception>
public ResiliencePipeline Build() => new(BuildPipelineComponent(), DisposeBehavior.Allow, Pool);
public ResiliencePipeline Build() => new(BuildPipelineComponent(), DisposeBehavior.Allow, ResilienceContextPool);
}
12 changes: 6 additions & 6 deletions src/Polly.Core/ResiliencePipelineBuilderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ private protected ResiliencePipelineBuilderBase(ResiliencePipelineBuilderBase ot
public string? InstanceName { get; set; }

/// <summary>
/// Gets or sets the resilience context pool associated with the builder.
/// Gets or sets the <see cref="Polly.ResilienceContextPool"/> associated with the builder.
/// </summary>
/// <remarks>
/// A custom pool can be used to configure custom behavior for ResilientContext creation.
/// A custom pool can be used to configure custom behavior for creation.
/// This can include setting a default <c>continueOnCapturedContext</c> parameter or custom operation key resolution.
/// </remarks>
/// <value>
/// If the default value of <see langword="null"/> is used, the default shared pool will be used.
/// If the default value of <see langword="null"/> is used, <see cref="ResilienceContextPool.Shared"/> will be used.
/// </value>
public ResilienceContextPool? Pool { get; set; }
public ResilienceContextPool? ResilienceContextPool { get; set; }

/// <summary>
/// Gets or sets a <see cref="TimeProvider"/> that is used by strategies that work with time.
/// Gets or sets a <see cref="System.TimeProvider"/> that is used by strategies that work with time.
/// </summary>
/// <remarks>
/// This property is internal until we switch to official System.TimeProvider.
Expand All @@ -79,7 +79,7 @@ private protected ResiliencePipelineBuilderBase(ResiliencePipelineBuilderBase ot
internal TimeProvider TimeProvider { get; set; } = TimeProvider.System;

/// <summary>
/// Gets or sets the <see cref="TelemetryListener"/> that is used by Polly to report resilience events.
/// Gets or sets the <see cref="Polly.Telemetry.TelemetryListener"/> that is used by Polly to report resilience events.
/// </summary>
/// <remarks>
/// This property is used by the telemetry infrastructure and should not be used directly by user code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public async Task DynamicContextPool_1687()

services.AddResiliencePipelineRegistry<string>(options => options.BuilderFactory = () => new ResiliencePipelineBuilder
{
Pool = pool,
ResilienceContextPool = pool,
});

services.AddResiliencePipeline(key, builder =>
{
builder.Pool.Should().Be(pool);
builder.ResilienceContextPool.Should().Be(pool);
builder.AddStrategy(strategy);
});

Expand Down

0 comments on commit 2954abd

Please sign in to comment.