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

Updating MediatR and switching to keyed services #99

Merged
merged 2 commits into from
Nov 25, 2023

Conversation

jbogard
Copy link
Contributor

@jbogard jbogard commented Nov 17, 2023

Fixes this issue called out by @davidfowl : https://x.com/davidfowl/status/1725559031484555616?s=20

Pretty neat way of approaching the design, too.

@@ -200,16 +200,8 @@ private async Task ProcessEvent(string eventName, string message)
// REVIEW: This could be done in parallel

// Get all the handlers using the event type as the key
// foreach (var handler in scope.ServiceProvider.GetKeyedServices<IIntegrationEventHandler>(eventType))

_subscriptionInfo.HandlerTypes.TryGetValue(eventType, out var handlerTypes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need this undeleted as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the keyed services not replace the whole HandlerTypes business? That you don't need to keep track of all the handler types to resolve, you rely on the container instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you're right here.

@davidfowl davidfowl merged commit 37cd432 into dotnet:main Nov 25, 2023
3 checks passed
@davidfowl
Copy link
Member

Thanks @jbogard !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants