#[non_exhaustive]pub enum BusEvent {
Process {
event: ProcessEventKind,
info: ProcessInfo,
manually: bool,
at_ms: u64,
},
LogOut {
id: u32,
line: String,
},
LogErr {
id: u32,
line: String,
},
Channel {
id: u32,
message: ChildMessage,
},
Dropped {
count: u64,
},
DaemonShutdown,
}Expand description
One event on the daemon bus
Uses adjacently tagged serde format with event discriminator and data wrapper.
Subscription TOPICS are the dotted strings from BusEvent::topic
(process.exit, log.out, daemon.* — spec §6 grammar).
Phase 2’s server-side filter globs against topic().
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Process
Lifecycle event for one sheep
LogOut
One stdout line from a sheep
LogErr
One stderr line from a sheep
Channel
One message a sheep wrote on its shepherd channel (fd 3).
Child->shepherd only. The shepherd’s own writes — the
{"kind":"shutdown"} of shutdown_with_message, and an action a
Trigger dispatched — are deliberately not here. Every one of them is
something an operator or the daemon just did and already has a
reporter: a shutdown message is followed by process.stop, and an
action is answered to the caller that sent it by
Response::Triggered. Putting them here as well would make this the
only event on the bus reporting a REQUEST rather than an outcome, and
would loop a dog that both subscribes and triggers back onto its own
dispatches. Adding the outbound half later stays additive — another
variant, more channel. topics, no version bump — so this is a
narrowing, not a door closed.
message is the app’s own text, whole and unredacted, unlike the
[dog.<name>] config that travels as DogSectionToml. Nothing on
this wire is a credential: Ready is empty, Metric is a name and a
float, and an ActionReply body is text the app chose to publish to
whoever triggered it. That is what makes a derived Debug safe here.
Fields
message: ChildMessageThe message, exactly as it came off fd 3.
Dropped
The bounded queue dropped this many events for this subscriber
DaemonShutdown
Daemon is shutting down