MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / with_bus

Method with_bus

crates/opencode-session/src/session.rs:768–774  ·  view source on GitHub ↗

Create a new SessionManager with a Bus for event publishing

(bus: Arc<Bus>)

Source from the content-addressed store, hash-verified

766
767 /// Create a new SessionManager with a Bus for event publishing
768 pub fn with_bus(bus: Arc<Bus>) -> Self {
769 Self {
770 sessions: HashMap::new(),
771 events: Vec::new(),
772 bus: Some(bus),
773 }
774 }
775
776 /// Publish an event to the Bus (fire-and-forget from sync context)
777 fn publish_event(&self, def: &'static BusEventDef, properties: serde_json::Value) {

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected