Configuration
Once installed, you will need to configure Mediate to use the EventQueueDispatchStrategy
.
For this, Mediate.BackgroundEventDispatch provides helper methods as IServiceCollection
extension methods.
You can use one of the following methods:
AddMediateEventQueueDispatchStrategy
Registers
EventQueueDispatchStrategy
as a scoped service. This method also registers a hosted service calledEventDispatcherService
a singleton queue calledEventQueue
and a singleton exception handler calledDefaultEventQueueExceptionHandler
. See EventQueueExceptionHandler for details.
AddMediateEventQueueDispatchStrategyCore
Registers
EventQueueDispatchStrategy
as a scoped service and returns a builder object that has some helper methods to configure the strategy. See Advanced configuration for details.This method also registers a hosted service called
EventDispatcherService
and a singleton queue calledEventQueue
.