22 references to Hedging
Microsoft.Extensions.Http.Resilience (5)
Hedging\Internals\Validators\HttpStandardHedgingResilienceOptionsCustomValidator.cs (3)
34
if (options.
Hedging
.DelayGenerator == null)
36
var maxHedgingDelay = TimeSpan.FromMilliseconds(options.
Hedging
.MaxHedgedAttempts * options.
Hedging
.Delay.TotalMilliseconds);
Hedging\ResilienceHttpClientBuilderExtensions.Hedging.cs (2)
84
options.
Hedging
.ActionGenerator = args =>
125
.AddHedging(options.
Hedging
);
Microsoft.Extensions.Http.Resilience.Tests (17)
Hedging\HttpStandardHedgingResilienceOptionsCustomValidatorTests.cs (4)
57
options.
Hedging
.MaxHedgedAttempts = 1;
58
options.
Hedging
.Delay = options.TotalRequestTimeout.Timeout;
62
options.
Hedging
.Delay = TimeSpan.FromDays(1);
63
options.
Hedging
.DelayGenerator = _ => new ValueTask<TimeSpan>(TimeSpan.FromDays(1));
Hedging\HttpStandardHedgingResilienceOptionsTests.cs (1)
26
_options.
Hedging
.Name.Should().Be("StandardHedging-Hedging");
Hedging\StandardHedgingTests.cs (12)
39
options.
Hedging
.MaxHedgedAttempts = DefaultHedgingAttempts;
40
options.
Hedging
.Delay = TimeSpan.FromMilliseconds(5);
47
Builder.Configure(options => options.
Hedging
.MaxHedgedAttempts = -1);
63
Builder.Configure(o => o.
Hedging
.MaxHedgedAttempts = 8);
68
Assert.Equal(8, options.
Hedging
.MaxHedgedAttempts);
83
Assert.Equal(8, options.
Hedging
.MaxHedgedAttempts);
105
Assert.Equal(8, options.
Hedging
.MaxHedgedAttempts);
113
var generator = options.
Hedging
.ActionGenerator;
248
Builder.Configure(config).Configure(options => options.
Hedging
.Delay = Timeout.InfiniteTimeSpan);
327
opt.
Hedging
.MaxHedgedAttempts = 10;
328
opt.
Hedging
.Delay = TimeSpan.FromSeconds(11);
348
protected override void ConfigureHedgingOptions(Action<HttpHedgingStrategyOptions> configure) => Builder.Configure(options => configure(options.
Hedging
));