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 is a lightweight multi-subscriber broadcaster for agent-loop events
func NewEventBus ¶
func NewEventBus() *EventBus
NewEventBus creates a new in-process event broadcaster
func (*EventBus) Close ¶
func (b *EventBus) Close()
Close closes all subscriber channels and stops future broadcasts
func (*EventBus) Emit ¶
Emit broadcasts an event to all current subscribers without blocking When a subscriber channel is full, the event is dropped for that subscriber
func (*EventBus) Subscribe ¶
func (b *EventBus) Subscribe(buffer int) EventSubscription
Subscribe registers a new subscriber with the requested channel buffer size A non-positive buffer uses the default size
func (*EventBus) Unsubscribe ¶
Unsubscribe removes a subscriber and closes its channel
type EventLogger ¶
type EventLogger struct {
// contains filtered or unexported fields
}
EventLogger is a simple subscriber that logs events
func (*EventLogger) On ¶
func (l *EventLogger) On(kind EventKind, handler func(Event))
On registers a handler for a specific event kind
type EventSubscription ¶
EventSubscription identifies a subscriber channel returned by EventBus.Subscribe