Unsubscribe from a topic.
(&self, topic_name: &str, sub_id: u64)
| 321 | |
| 322 | /// Unsubscribe from a topic. |
| 323 | pub fn unsubscribe(&self, topic_name: &str, sub_id: u64) { |
| 324 | let topics = super::lock_utils::read_or_recover(self.topics.read(), "topics"); |
| 325 | if let Some(topic_mutex) = topics.get(topic_name) { |
| 326 | let mut topic = super::lock_utils::lock_or_recover(topic_mutex.lock(), "topic"); |
| 327 | topic.subscribers.remove(&sub_id); |
| 328 | debug!(topic = topic_name, sub_id, "unsubscribed"); |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | /// Get topic stats. |
| 333 | pub fn topic_stats(&self, topic_name: &str) -> Option<TopicStats> { |
nothing calls this directly
no test coverage detected