pub struct Bus { /* private fields */ }Expand description
Cross-thread event channel. Once a buffer crosses a Queue boundary,
errors can no longer be propagated up the call stack with ? — they’re
posted here instead so the owner of the Pipeline can observe them.
Implementations§
Source§impl Bus
impl Bus
Sourcepub fn new() -> (Bus, BusReceiver)
pub fn new() -> (Bus, BusReceiver)
Creates an unbounded event channel with no graph element identity.
Pipeline construction derives element-specific senders internally.
Standalone elements and drivers can use the returned sender directly;
their BusMessage::element_id remains None.
Sourcepub fn post(&self, pp_log: &PpLog, event: BusEvent)
pub fn post(&self, pp_log: &PpLog, event: BusEvent)
Logs and enqueues an event without blocking on the receiver.
If the receiving half has already been dropped, the event is discarded; posting never turns pipeline teardown into another error.
pp_log is the posting element’s own crate::element::Element::pp_log
— used (via crate::pp_log’s pp_log: macro form) instead of event’s
own name so the element’s full identity, pipeline id included, reaches
the log record rather than just the name carried in the event.