Documentation
¶
Overview ¶
Package bus is the in-process event broker between the core and its clients. Publishing never blocks the agent loop: streaming lanes are lossy under a slow subscriber, control lanes are not.
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.
type Lane ¶
type Lane int
Lane picks the delivery contract for a subscription.
const ( // Lossy drops the oldest buffered event when a subscriber falls // behind. Streaming deltas ride this lane; a stalled TUI must never // stall the agent. Lossy Lane = iota // MustDeliver blocks the publisher until the subscriber drains. // Permission requests and terminal events ride this lane; dropping // one would wedge a turn. MustDeliver )
type Sub ¶
Sub is one subscription. Receive from C in a select that also watches Done. C is never closed (a publisher may be mid-send when the subscription is cancelled); Done closing is the termination signal.
func (*Sub) Cancel ¶
func (s *Sub) Cancel()
Cancel removes the subscription. Events already buffered in C stay readable; no new ones arrive after Done closes.
Click to show internal directories.
Click to hide internal directories.