Skip to content

Commit

Permalink
Update with latest API
Browse files Browse the repository at this point in the history
  • Loading branch information
martintmk committed Sep 20, 2023
1 parent b0cf55e commit 0c8fbec
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Assembly 'Polly.Core'

using System.Runtime.CompilerServices;

namespace Polly.Simmy.Outcomes;

public readonly struct FaultGeneratorArguments
{
public ResilienceContext Context { get; }
public FaultGeneratorArguments(ResilienceContext context);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Assembly 'Polly.Core'

using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;

namespace Polly.Simmy.Outcomes;

public class FaultStrategyOptions : MonkeyStrategyOptions
{
public Func<OnFaultInjectedArguments, ValueTask>? OnFaultInjected { get; set; }
public Func<FaultGeneratorArguments, ValueTask<Exception?>>? FaultGenerator { get; set; }
public Exception? Fault { get; set; }
public FaultStrategyOptions();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Assembly 'Polly.Core'

using System;
using System.Runtime.CompilerServices;

namespace Polly.Simmy.Outcomes;

public readonly struct OnFaultInjectedArguments
{
public ResilienceContext Context { get; }
public Exception Fault { get; }
public OnFaultInjectedArguments(ResilienceContext context, Exception fault);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Polly.Simmy;

public static class BehaviorChaosPipelineBuilderExtensions
public static class BehaviorPipelineBuilderExtensions
{
public static TBuilder AddChaosBehavior<TBuilder>(this TBuilder builder, bool enabled, double injectionRate, Func<ValueTask> behavior) where TBuilder : ResiliencePipelineBuilderBase;
public static TBuilder AddChaosBehavior<TBuilder>(this TBuilder builder, BehaviorStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Polly.Simmy;

public static class LatencyChaosPipelineBuilderExtensions
public static class LatencyPipelineBuilderExtensions
{
public static TBuilder AddChaosLatency<TBuilder>(this TBuilder builder, bool enabled, double injectionRate, TimeSpan latency) where TBuilder : ResiliencePipelineBuilderBase;
public static TBuilder AddChaosLatency<TBuilder>(this TBuilder builder, LatencyStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

namespace Polly.Simmy;

public static class OutcomeChaosPipelineBuilderExtensions
public static class OutcomePipelineBuilderExtensions
{
public static ResiliencePipelineBuilder AddChaosFault(this ResiliencePipelineBuilder builder, bool enabled, double injectionRate, Exception fault);
public static ResiliencePipelineBuilder AddChaosFault(this ResiliencePipelineBuilder builder, bool enabled, double injectionRate, Func<Exception?> faultGenerator);
public static ResiliencePipelineBuilder AddChaosFault(this ResiliencePipelineBuilder builder, OutcomeStrategyOptions<Exception> options);
public static ResiliencePipelineBuilder AddChaosFault(this ResiliencePipelineBuilder builder, FaultStrategyOptions options);
public static ResiliencePipelineBuilder<TResult> AddChaosFault<TResult>(this ResiliencePipelineBuilder<TResult> builder, bool enabled, double injectionRate, Exception fault);
public static ResiliencePipelineBuilder<TResult> AddChaosFault<TResult>(this ResiliencePipelineBuilder<TResult> builder, bool enabled, double injectionRate, Func<Exception?> faultGenerator);
public static ResiliencePipelineBuilder<TResult> AddChaosFault<TResult>(this ResiliencePipelineBuilder<TResult> builder, OutcomeStrategyOptions<Exception> options);
public static ResiliencePipelineBuilder<TResult> AddChaosFault<TResult>(this ResiliencePipelineBuilder<TResult> builder, FaultStrategyOptions options);
public static ResiliencePipelineBuilder<TResult> AddChaosResult<TResult>(this ResiliencePipelineBuilder<TResult> builder, bool enabled, double injectionRate, TResult result);
public static ResiliencePipelineBuilder<TResult> AddChaosResult<TResult>(this ResiliencePipelineBuilder<TResult> builder, bool enabled, double injectionRate, Func<TResult?> outcomeGenerator);
public static ResiliencePipelineBuilder<TResult> AddChaosResult<TResult>(this ResiliencePipelineBuilder<TResult> builder, OutcomeStrategyOptions<TResult> options);
Expand Down

0 comments on commit 0c8fbec

Please sign in to comment.