Documentation
¶
Overview ¶
Package event defines typed event structures for system-wide event bus communication including file changes, git updates, and UI refresh notifications.
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 fan-out event routing between plugins.
func NewWithLogger ¶
func NewWithLogger(logger *slog.Logger) *Dispatcher
NewWithLogger creates a dispatcher with custom logger.
func (*Dispatcher) Close ¶
func (d *Dispatcher) Close()
Close shuts down the dispatcher and all subscriber channels.
func (*Dispatcher) Publish ¶
func (d *Dispatcher) Publish(topic string, e Event)
Publish sends an event to all subscribers of a topic. Non-blocking: drops events if subscriber buffer is full.
func (*Dispatcher) PublishAll ¶
func (d *Dispatcher) PublishAll(e Event)
PublishAll sends an event to all subscribers of all topics.
func (*Dispatcher) Subscribe ¶
func (d *Dispatcher) Subscribe(topic string) <-chan Event
Subscribe creates a buffered channel for receiving events on a topic.
type Type ¶
type Type string
Type identifies the kind of event.
const ( // File change events TypeFileChanged Type = "file_changed" TypeGitChanged Type = "git_changed" TypeSessionFile Type = "session_file" // Data update events TypeTDUpdate Type = "td_update" TypeSessionUpdate Type = "session_update" // UI events TypeFocusChanged Type = "focus_changed" TypeRefreshNeeded Type = "refresh_needed" // Error events TypeError Type = "error" )
Click to show internal directories.
Click to hide internal directories.