event

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

type EventBus struct {
	// contains filtered or unexported fields
}

EventBus represents a simple event bus for inter-extension communication

func NewEventBus

func NewEventBus() *EventBus

NewEventBus creates a new EventBus

func (*EventBus) GetMetrics

func (eb *EventBus) GetMetrics() map[string]any

GetMetrics returns metrics

func (*EventBus) Publish

func (eb *EventBus) Publish(eventName string, data any)

Publish sends an event to all subscribers

func (*EventBus) PublishWithRetry

func (eb *EventBus) PublishWithRetry(eventName string, data any, maxRetries int)

PublishWithRetry retry publish event

func (*EventBus) Subscribe

func (eb *EventBus) Subscribe(eventName string, handler func(any))

Subscribe adds a subscriber for a specific event

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL