Documentation
¶
Overview ¶
Package eventbus is the typed in-process event bus through which background components meet (AGENTS.md section 4). Publish never blocks; each subscriber has a bounded buffer and its own overflow policy.
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 events out to subscribers.
func (*Bus) Subscribe ¶
func (b *Bus) Subscribe(size int, policy Overflow) *Subscription
Subscribe registers a subscriber with a buffer of size (at least 1).
func (*Bus) Unsubscribe ¶
func (b *Bus) Unsubscribe(s *Subscription)
Unsubscribe removes s and closes its channel (the bus is the sender, so it closes).
type DeviceState ¶
DeviceState reports a device health change (online, offline, stale, unconfigured).
type Event ¶
type Event interface {
// contains filtered or unexported methods
}
Event is any published event; the concrete types are defined below.
type SiteChanged ¶
SiteChanged reports a new configuration revision; Keys are the live keys of the new site (spec 9.3 site_changed).
type StatusChanged ¶
StatusChanged reports a changed device status register.
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Subscription receives events on C until Unsubscribe; the bus closes C then.
func (*Subscription) Dropped ¶
func (s *Subscription) Dropped() uint64
Dropped returns the number of events lost to overflow.
type ValueChanged ¶
ValueChanged reports a new live value of a key ("<meter>/<channel>").