Skip to content

Commit

Permalink
Minor API cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
martintmk committed Aug 23, 2023
1 parent a61b343 commit 71db9fe
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/Polly.Core/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Polly.Core/Retry/OnRetryArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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
Expand Up @@ -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
Expand Up @@ -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;
Expand Down
7 changes: 1 addition & 6 deletions src/Polly.Testing/ResilienceStrategyDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/Polly.Core.Tests/Retry/OnRetryArgumentsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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;
};
Expand Down

0 comments on commit 71db9fe

Please sign in to comment.