interface to be implemented by an event bus
public interface IEventBus
PublishAsync<TEvent>(TEvent, Mode, CancellationToken)
publishes a given event model to all subscribers registered to handle the that type of event.
Task PublishAsync<TEvent>(TEvent eventModel, Mode waitMode = Mode.WaitForAll, CancellationToken cancellation = default(CancellationToken))
the notification event model/dto to publish
specify whether to wait for none, any or all of the subscribers to complete their work
an optional cancellation token
a Task that matches the wait mode specified. WaitForNone returns an already completed Task (fire and forget). WaitForAny returns a Task that will complete when any of the subscribers complete their work. WaitForAll return a Task that will complete only when all of the subscribers complete their work.
the type of the event model