Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(maxWorkers int) *Dispatcher
func (*Dispatcher) AddEventProviders ¶
func (d *Dispatcher) AddEventProviders(providers ...<-chan event.Event)
AddEventProviders registers provided channels as an event source. Events from these providers will be parsed by the subscribed handlers
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch(e event.Event)
func (*Dispatcher) Register ¶
func (d *Dispatcher) Register(h ...Listener)
Register is a helper method allowing to subscribe multiple event listeners at once.
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run(ctx context.Context)
Run blocks until the context is cancelled. Run starts the dispatcher to listen for events from its event providers and dispatch those events.
type Listener ¶
type Listener interface { // EventHandlers returns all event handlers specific to an implementation // which are registered at the composition root. // These handlers should not be used to sync read and write models // and should be separated from them, applying other domain events. EventHandlers() map[event.EventType][]event.Handler }
Click to show internal directories.
Click to hide internal directories.