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

Method publish_event

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

Publish an event to the Bus (fire-and-forget from sync context)

(&self, def: &'static BusEventDef, properties: serde_json::Value)

Source from the content-addressed store, hash-verified

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) {
778 if let Some(ref bus) = self.bus {
779 if let Ok(handle) = tokio::runtime::Handle::try_current() {
780 let bus = bus.clone();
781 handle.spawn(async move {
782 bus.publish(def, properties).await;
783 });
784 }
785 }
786 }
787
788 /// Publish a session info event (Created/Updated/Deleted)
789 fn publish_session_event(&self, def: &'static BusEventDef, session: &Session) {

Callers 9

publish_session_eventMethod · 0.80
publish_message_eventMethod · 0.80
publish_part_eventMethod · 0.80
publish_part_deltaMethod · 0.80
remove_messageMethod · 0.80
remove_partMethod · 0.80
publish_errorMethod · 0.80
publish_diffMethod · 0.80

Calls 3

spawnMethod · 0.80
publishMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected