Check if any connected Lite session subscribes to this collection.
(&self, tenant_id: u64, collection: &str)
| 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 | /// |
no test coverage detected