When registering with a DomainEventSource, listeners should be able to specify a mode of dispatch. Initially, two modes are supported:
- immediate: listeners are called immediately when an event is dispatched, while the event producer waits.
- deferred: listeners are called after the current transaction has been completed successfully.
In the future, we may add more dispatch modes, e.g. fully async, like jobs.