Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor API cleanup #1508

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Polly.Core/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -269,9 +269,9 @@ Polly.ResilienceStrategyOptions.Name.set -> void
Polly.ResilienceStrategyOptions.ResilienceStrategyOptions() -> void
Polly.Retry.OnRetryArguments
Polly.Retry.OnRetryArguments.AttemptNumber.get -> int
Polly.Retry.OnRetryArguments.ExecutionTime.get -> System.TimeSpan
Polly.Retry.OnRetryArguments.Duration.get -> System.TimeSpan
Polly.Retry.OnRetryArguments.OnRetryArguments() -> void
Polly.Retry.OnRetryArguments.OnRetryArguments(int attemptNumber, System.TimeSpan retryDelay, System.TimeSpan executionTime) -> void
Polly.Retry.OnRetryArguments.OnRetryArguments(int attemptNumber, System.TimeSpan retryDelay, System.TimeSpan duration) -> void
Polly.Retry.OnRetryArguments.RetryDelay.get -> System.TimeSpan
Polly.Retry.RetryBackoffType
Polly.Retry.RetryBackoffType.Constant = 0 -> Polly.Retry.RetryBackoffType
10 changes: 5 additions & 5 deletions src/Polly.Core/Retry/OnRetryArguments.cs
Original file line number Diff line number Diff line change
@@ -15,12 +15,12 @@ public readonly struct OnRetryArguments
/// </summary>
/// <param name="attemptNumber">The zero-based attempt number.</param>
/// <param name="retryDelay">The delay before the next retry.</param>
/// <param name="executionTime">The execution time of this attempt.</param>
public OnRetryArguments(int attemptNumber, TimeSpan retryDelay, TimeSpan executionTime)
/// <param name="duration">The duration of this attempt.</param>
public OnRetryArguments(int attemptNumber, TimeSpan retryDelay, TimeSpan duration)
{
AttemptNumber = attemptNumber;
RetryDelay = retryDelay;
ExecutionTime = executionTime;
Duration = duration;
}

/// <summary>
@@ -34,7 +34,7 @@ public OnRetryArguments(int attemptNumber, TimeSpan retryDelay, TimeSpan executi
public TimeSpan RetryDelay { get; }

/// <summary>
/// Gets the execution time of this attempt.
/// Gets the duration of this attempt.
/// </summary>
public TimeSpan ExecutionTime { get; }
public TimeSpan Duration { get; }
}
2 changes: 0 additions & 2 deletions src/Polly.Testing/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -2,12 +2,10 @@
Polly.Testing.ResiliencePipelineDescriptor
Polly.Testing.ResiliencePipelineDescriptor.FirstStrategy.get -> Polly.Testing.ResilienceStrategyDescriptor!
Polly.Testing.ResiliencePipelineDescriptor.IsReloadable.get -> bool
Polly.Testing.ResiliencePipelineDescriptor.ResiliencePipelineDescriptor(System.Collections.Generic.IReadOnlyList<Polly.Testing.ResilienceStrategyDescriptor!>! strategies, bool isReloadable) -> void
Polly.Testing.ResiliencePipelineDescriptor.Strategies.get -> System.Collections.Generic.IReadOnlyList<Polly.Testing.ResilienceStrategyDescriptor!>!
Polly.Testing.ResiliencePipelineExtensions
Polly.Testing.ResilienceStrategyDescriptor
Polly.Testing.ResilienceStrategyDescriptor.Options.get -> Polly.ResilienceStrategyOptions?
Polly.Testing.ResilienceStrategyDescriptor.ResilienceStrategyDescriptor(Polly.ResilienceStrategyOptions? options, object! strategyInstance) -> void
Polly.Testing.ResilienceStrategyDescriptor.StrategyInstance.get -> object!
static Polly.Testing.ResiliencePipelineExtensions.GetPipelineDescriptor(this Polly.ResiliencePipeline! pipeline) -> Polly.Testing.ResiliencePipelineDescriptor!
static Polly.Testing.ResiliencePipelineExtensions.GetPipelineDescriptor<TResult>(this Polly.ResiliencePipeline<TResult>! pipeline) -> Polly.Testing.ResiliencePipelineDescriptor!
7 changes: 1 addition & 6 deletions src/Polly.Testing/ResiliencePipelineDescriptor.cs
Original file line number Diff line number Diff line change
@@ -5,12 +5,7 @@
/// </summary>
public sealed class ResiliencePipelineDescriptor
{
/// <summary>
/// Initializes a new instance of the <see cref="ResiliencePipelineDescriptor"/> class.
/// </summary>
/// <param name="strategies">The strategies the pipeline is composed of.</param>
/// <param name="isReloadable">Determines whether the resilience pipeline is reloadable.</param>
public ResiliencePipelineDescriptor(IReadOnlyList<ResilienceStrategyDescriptor> strategies, bool isReloadable)
internal ResiliencePipelineDescriptor(IReadOnlyList<ResilienceStrategyDescriptor> strategies, bool isReloadable)
{
Strategies = strategies;
IsReloadable = isReloadable;
7 changes: 1 addition & 6 deletions src/Polly.Testing/ResilienceStrategyDescriptor.cs
Original file line number Diff line number Diff line change
@@ -5,12 +5,7 @@
/// </summary>
public sealed class ResilienceStrategyDescriptor
{
/// <summary>
/// Initializes a new instance of the <see cref="ResilienceStrategyDescriptor"/> class.
/// </summary>
/// <param name="options">The options used by the resilience strategy, if any.</param>
/// <param name="strategyInstance">The strategy instance.</param>
public ResilienceStrategyDescriptor(ResilienceStrategyOptions? options, object strategyInstance)
internal ResilienceStrategyDescriptor(ResilienceStrategyOptions? options, object strategyInstance)
{
Options = options;
StrategyInstance = strategyInstance;
2 changes: 1 addition & 1 deletion test/Polly.Core.Tests/Retry/OnRetryArgumentsTests.cs
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@ public void Ctor_Ok()

args.AttemptNumber.Should().Be(2);
args.RetryDelay.Should().Be(TimeSpan.FromSeconds(3));
args.ExecutionTime.Should().Be(TimeSpan.MaxValue);
args.Duration.Should().Be(TimeSpan.MaxValue);
}
}
Original file line number Diff line number Diff line change
@@ -238,7 +238,7 @@ public async Task OnRetry_EnsureExecutionTime()
{
_options.OnRetry = args =>
{
args.Arguments.ExecutionTime.Should().Be(TimeSpan.FromMinutes(1));
args.Arguments.Duration.Should().Be(TimeSpan.FromMinutes(1));

return default;
};