-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup Microsoft.Extensions.Http.Resilience internals (#4141)
- Loading branch information
Showing
51 changed files
with
450 additions
and
550 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
bench/Libraries/Microsoft.Extensions.Http.Resilience.PerformanceTests/EmptyHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Net.Http; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.Extensions.Http.Resilience.Bench; | ||
|
||
internal sealed class EmptyHandler : DelegatingHandler | ||
{ | ||
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) | ||
{ | ||
return await base.SendAsync(request, cancellationToken).ConfigureAwait(false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
src/Libraries/Microsoft.Extensions.Http.Resilience/Internal/IHttpRequestMessageSnapshot.cs
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
src/Libraries/Microsoft.Extensions.Http.Resilience/Internal/IRandomizer.cs
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/Libraries/Microsoft.Extensions.Http.Resilience/Internal/IRequestCloner.cs
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/Libraries/Microsoft.Extensions.Http.Resilience/Internal/NamedOptionsCache.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.Extensions.Options; | ||
|
||
namespace Microsoft.Extensions.Http.Resilience.Internal; | ||
|
||
/// <summary> | ||
/// The cache for named options that allows accessing the last valid options instance. | ||
/// </summary> | ||
/// <typeparam name="TOptions">The type of options.</typeparam> | ||
internal sealed class NamedOptionsCache<TOptions> | ||
{ | ||
public NamedOptionsCache(string optionsName, IOptionsMonitor<TOptions> optionsMonitor) | ||
{ | ||
Options = optionsMonitor.Get(optionsName); | ||
|
||
_ = optionsMonitor.OnChange((options, name) => | ||
{ | ||
if (name == optionsName) | ||
{ | ||
Options = options; | ||
} | ||
}); | ||
} | ||
|
||
public TOptions Options { get; private set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 0 additions & 94 deletions
94
src/Libraries/Microsoft.Extensions.Http.Resilience/Internal/RequestCloner.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.