Replies: 2 comments 2 replies
-
MediatR is completely synchronous, it's not really a bus. You shouldn't really compare the two. If you need asynchronous messaging, you should look at something like SignalR. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Implement the Mediatr INotificationHandler<...> on your component class so you can handle the notification event within the component? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everybody,
I am coming from the classic Event Aggregator Pattern. While MediatR seems to work more like a ServiceBus (NServiceBus f.e.) where Handlers are autonomous nodes I still can't seem to understand how a Blazor Component can interact with a handler or would the handling Interface (IHandleNotification) be implemented in the Component like with an EventAggregator. I don't have every Component registered in the DI-Container (and don't want to) but they are mostly built by the Blazor Rendering system. How could a component that is interested in getting a message from any Publisher receive that message? With an EventAggregator one would inject the Aggregator und register but here MediatR seems to register by type and the resolve which may be fine for handlers but not for all components.
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions