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
}
Dispatcher handles event publishing and subscription
func NewEventDispatcher ¶
func NewEventDispatcher() *Dispatcher
NewEventDispatcher creates a new event dispatcher
func (*Dispatcher) GetMetrics ¶
func (d *Dispatcher) GetMetrics() map[string]any
GetMetrics returns metrics
func (*Dispatcher) Publish ¶
func (d *Dispatcher) Publish(eventName string, data any)
Publish sends event to all subscribers
func (*Dispatcher) PublishWithRetry ¶
func (d *Dispatcher) PublishWithRetry(eventName string, data any, maxRetries int)
PublishWithRetry publishes event with retry
func (*Dispatcher) Subscribe ¶
func (d *Dispatcher) Subscribe(eventName string, handler func(any))
Subscribe adds a handler for specific event
Click to show internal directories.
Click to hide internal directories.