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

Method subscribe_all

crates/opencode-core/src/bus.rs:99–116  ·  view source on GitHub ↗
(&self, callback: F)

Source from the content-addressed store, hash-verified

97 }
98
99 pub async fn subscribe_all<F>(&self, callback: F) -> u64
100 where
101 F: Fn(&str, serde_json::Value) + Send + Sync + 'static,
102 {
103 let id = {
104 let mut next = self.next_id.write().await;
105 *next += 1;
106 *next
107 };
108
109 let mut wildcard = self.wildcard_subscribers.write().await;
110 wildcard.push(Subscription {
111 id,
112 callback: Box::new(callback),
113 });
114
115 id
116 }
117
118 pub async fn unsubscribe_all(&self, id: u64) {
119 let mut wildcard = self.wildcard_subscribers.write().await;

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected