Documentation
¶
Overview ¶
Package bus is the in-process fan-out for live frames: every stored event, session change, or alert is published once and delivered to every subscriber (WebSocket clients, the loop detector, tests). Slow subscribers are dropped rather than allowed to stall the writer — the UI can always catch up via REST.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus fans frames out to subscribers.
func (*Bus) Subscribe ¶
func (b *Bus) Subscribe(buffer int) *Subscriber
Subscribe registers a subscriber with the given buffer size.
func (*Bus) Subscribers ¶
Subscribers returns the current subscriber count.
type Subscriber ¶
type Subscriber struct {
C chan Frame
// contains filtered or unexported fields
}
Subscriber receives frames on C. Close it with Unsubscribe.
func (*Subscriber) Unsubscribe ¶
func (s *Subscriber) Unsubscribe()
Unsubscribe removes the subscriber and closes its channel.