Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDomainEventBus ¶
func NewDomainEventBus(l logger.Logger, mw ...Middleware) (domainevent.Publisher, domainevent.Subscriber)
NewDomainEventBus builds the bus. Optional middleware wraps every handler; handler panics are always recovered and converted to errors regardless of the middleware set.
Types ¶
type Middleware ¶
type Middleware func(next domainevent.Handler) domainevent.Handler
Middleware wraps a domainevent.Handler to add cross-cutting behaviour (logging, metrics, tracing, recovery). Middleware passed to NewDomainEventBus runs outermost-first around every handler; a built-in recovery layer always sits closest to the handler so a handler panic surfaces as an error to the middleware above it.
type SyncBus ¶
type SyncBus struct {
// contains filtered or unexported fields
}
SyncBus is an in-memory synchronous event bus for domain events with subscription and publishing capabilities.
func (*SyncBus) PublishAll ¶
PublishAll dispatches events in order, aborting on the first handler error.