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

Simplify file names #1455

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
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
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
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
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