Skip to content

Commit

Permalink
Simplify file names (#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
martintmk authored Aug 7, 2023
1 parent 0f38c51 commit 3831b40
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Polly.CircuitBreaker;

internal sealed class CircuitBreakerResilienceStrategy<T> : OutcomeResilienceStrategy<T>
internal sealed class CircuitBreakerResilienceStrategy<T> : ReactiveResilienceStrategy<T>
{
private readonly Func<OutcomeArguments<T, CircuitBreakerPredicateArguments>, ValueTask<bool>> _handler;
private readonly CircuitStateController<T> _controller;
Expand Down
2 changes: 1 addition & 1 deletion src/Polly.Core/Fallback/FallbackResilienceStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Polly.Fallback;

#pragma warning disable CA1031 // Do not catch general exception types

internal sealed class FallbackResilienceStrategy<T> : OutcomeResilienceStrategy<T>
internal sealed class FallbackResilienceStrategy<T> : ReactiveResilienceStrategy<T>
{
private readonly FallbackHandler<T> _handler;
private readonly Func<OutcomeArguments<T, OnFallbackArguments>, ValueTask>? _onFallback;
Expand Down
2 changes: 1 addition & 1 deletion src/Polly.Core/Hedging/HedgingResilienceStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Polly.Hedging;

internal sealed class HedgingResilienceStrategy<T> : OutcomeResilienceStrategy<T>
internal sealed class HedgingResilienceStrategy<T> : ReactiveResilienceStrategy<T>
{
private readonly TimeProvider _timeProvider;
private readonly ResilienceStrategyTelemetry _telemetry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Polly.Utils;
namespace Polly;

/// <summary>
/// This base strategy class is used to simplify the implementation of generic (reactive)
Expand All @@ -8,7 +8,7 @@
/// <remarks>
/// For strategies that handle all result types the generic parameter must be of type <see cref="object"/>.
/// </remarks>
internal abstract class OutcomeResilienceStrategy<T> : ResilienceStrategy
internal abstract class ReactiveResilienceStrategy<T> : ResilienceStrategy
{
protected internal sealed override ValueTask<Outcome<TResult>> ExecuteCore<TResult, TState>(
Func<ResilienceContext, TState, ValueTask<Outcome<TResult>>> callback,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,8 @@ namespace Polly;

#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads

/// <summary>
/// Resilience strategy is used to execute the user-provided callbacks.
/// </summary>
/// <typeparam name="T">The type of result this strategy supports.</typeparam>
/// <remarks>
/// Resilience strategy supports various types of callbacks of <typeparamref name="T"/> result type
/// and provides a unified way to execute them. This includes overloads for synchronous and asynchronous callbacks.
/// </remarks>
public partial class ResilienceStrategy<T>
{
internal ResilienceStrategy(ResilienceStrategy strategy) => Strategy = strategy;

internal ResilienceStrategy Strategy { get; }

/// <summary>
/// Executes the specified callback.
/// </summary>
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions src/Polly.Core/ResilienceStrategyT.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Polly;

/// <summary>
/// Resilience strategy is used to execute the user-provided callbacks.
/// </summary>
/// <typeparam name="T">The type of result this strategy supports.</typeparam>
/// <remarks>
/// Resilience strategy supports various types of callbacks of <typeparamref name="T"/> result type
/// and provides a unified way to execute them. This includes overloads for synchronous and asynchronous callbacks.
/// </remarks>
public partial class ResilienceStrategy<T>
{
internal ResilienceStrategy(ResilienceStrategy strategy) => Strategy = strategy;

internal ResilienceStrategy Strategy { get; }
}
2 changes: 1 addition & 1 deletion src/Polly.Core/Retry/RetryResilienceStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Polly.Retry;

internal sealed class RetryResilienceStrategy<T> : OutcomeResilienceStrategy<T>
internal sealed class RetryResilienceStrategy<T> : ReactiveResilienceStrategy<T>
{
private readonly TimeProvider _timeProvider;
private readonly ResilienceStrategyTelemetry _telemetry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Polly.Utils;
namespace Polly.Core.Tests.Utils;

namespace Polly.Core.Tests.Utils;

public class OutcomeResilienceStrategyTests
public class ReactiveResilienceStrategyTests
{
[Fact]
public void Ctor_Ok()
Expand Down Expand Up @@ -62,7 +60,7 @@ public void Pipeline_TypeCheck_Ok()
called.Should().BeTrue();
}

private class Strategy<T> : OutcomeResilienceStrategy<T>
private class Strategy<T> : ReactiveResilienceStrategy<T>
{
private readonly Action<Outcome<T>> _onOutcome;

Expand Down

0 comments on commit 3831b40

Please sign in to comment.