Skip to content

Commit

Permalink
NOTES
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Sep 21, 2024
1 parent 94c6244 commit 54f5634
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Shiny.Mediator.Resilience.Handlers;
//https://learn.microsoft.com/en-us/dotnet/core/resilience/?tabs=dotnet-cli
//https://devblogs.microsoft.com/dotnet/building-resilient-cloud-services-with-dotnet-8/
public class ResilientRequestHandlerMiddleware<TRequest, TResult>(
IConfiguration config,
IConfiguration configuration,
ResiliencePipelineProvider<string> pipelineProvider
) : IRequestMiddleware<TRequest, TResult> where TRequest : IRequest<TResult>
{
Expand All @@ -32,6 +32,9 @@ public async Task<TResult> Process(
CancellationToken cancellationToken
)
{
// TODO: configuration should also setup resilience pipelines at startup?
var section = configuration.GetHandlerSection("Resilience", request!, requestHandler);

var attribute = requestHandler.GetHandlerHandleMethodAttribute<TRequest, ResilientAttribute>();
attribute ??= request.GetType().GetCustomAttribute<ResilientAttribute>();
if (attribute == null)
Expand Down
5 changes: 4 additions & 1 deletion tests/Shiny.Mediator.Tests/ConfigurationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ public class ConfigurationTests(ITestOutputHelper output)
[Fact]
public void AddConfiguration()
{
// var config = new ConfigurationManager();
// TODO: ORDER: config, attribute contract, attribute handler
// TODO: config order: full type, exact namespace, sub namespace, *
var dict = new Dictionary<string, object>();
var config = new ConfigurationManager();
// config.AddConfiguration(new MemoryConfigurationProvider(new MemoryConfigurationSource().InitialData));
// config.Get("key1").Should().Be("value1");
}
Expand Down

0 comments on commit 54f5634

Please sign in to comment.