MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / has_subscribers

Method has_subscribers

nodedb/src/event/crdt_sync/delivery.rs:163–170  ·  view source on GitHub ↗

Check if any connected Lite session subscribes to this collection.

(&self, tenant_id: u64, collection: &str)

Source from the content-addressed store, hash-verified

161
162 /// Check if any connected Lite session subscribes to this collection.
163 pub fn has_subscribers(&self, tenant_id: u64, collection: &str) -> bool {
164 let sessions = self.sessions.read().unwrap_or_else(|p| p.into_inner());
165 sessions.values().any(|s| {
166 s.tenant_id == tenant_id
167 && (s.subscribed_collections.is_empty()
168 || s.subscribed_collections.iter().any(|c| c == collection))
169 })
170 }
171
172 /// Enqueue an outbound delta for delivery to all matching sessions.
173 ///

Callers 1

package_and_enqueueMethod · 0.80

Calls 3

readMethod · 0.45
is_emptyMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected