Documentation
¶
Index ¶
- Variables
- type Config
- type Event
- type EventBus
- func (bus *EventBus) Cleanup()
- func (bus *EventBus) Dispatch(event Event)
- func (bus *EventBus) DispatchSync(event Event)
- func (bus *EventBus) Init() error
- func (bus *EventBus) Listen()
- func (bus *EventBus) Publish(event Event)
- func (bus *EventBus) PublishSync(event Event) (any, error)
- func (bus *EventBus) Subscribe(eventName string, handler EventHandler)
- type EventHandler
- type Metrics
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEventTimeout = errors.New("event timeout") ErrFailedToCreateMetrics = errors.New("failed to create event metrics") )
View Source
var ErrFailedToBuildEventDispatchesCounter = errors.New(
"failed to build event dispatches counter",
)
Functions ¶
This section is empty.
Types ¶
type EventBus ¶
type EventBus struct {
InnerMetrics *Metrics
Subscribers map[string][]EventHandler
Queue chan Event
Config *Config
// contains filtered or unexported fields
}
func NewEventBus ¶
func (*EventBus) DispatchSync ¶
func (*EventBus) Subscribe ¶
func (bus *EventBus) Subscribe(eventName string, handler EventHandler)
type EventHandler ¶
type EventHandler func(event Event)
type Metrics ¶
type Metrics struct {
EventDispatchesTotal *metricsfx.CounterMetric
// contains filtered or unexported fields
}
Metrics holds event-specific metrics using the simplified MetricsBuilder approach.
func NewMetrics ¶
func NewMetrics(provider *metricsfx.MetricsProvider) *Metrics
NewMetrics creates event metrics using the simplified MetricsBuilder.
Click to show internal directories.
Click to hide internal directories.