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) 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
- type MetricsProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEventTimeout = errors.New("event timeout")
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 NewEventBus( config *Config, metricsProvider MetricsProvider, logger *logfx.Logger, ) *EventBus
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 {
RequestsTotal *prometheus.CounterVec
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics(mp MetricsProvider) *Metrics
type MetricsProvider ¶
type MetricsProvider interface {
GetRegistry() *prometheus.Registry
}
Click to show internal directories.
Click to hide internal directories.