When dealing with events (notifications in MediatR), the publisher should be agnostic of who’s interested in handling these events, therefore the publisher cannot guarantee order of execution. On the subscriber side, It will depend on the order in witch the handlers we registered in the DI container (which can be very arbitrary). In any case, if the handlers are handling the same type of event, I’d recommend you implementing them ignoring the order of execution, because that cannot be guaranteed and your code become less dependent on the other.

Regarding exceptions, the first exception that happens will bubble up and the rest will be stopped as all possible pending tasks will be cancelled. You can see internally in MediatR why this would happen: https://github.com/jbogard/MediatR/blob/365672f8f660c2dd2b2e062fcb4f3d5e30944234/src/MediatR/Mediator.cs#L108

It iterates over a list of handlers and awaits each of them individually.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store