(&self, event_type: &str, id: u64)
| 90 | } |
| 91 | |
| 92 | pub async fn unsubscribe(&self, event_type: &str, id: u64) { |
| 93 | let mut subscribers = self.subscribers.write().await; |
| 94 | if let Some(subs) = subscribers.get_mut(event_type) { |
| 95 | subs.retain(|s| s.id != id); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | pub async fn subscribe_all<F>(&self, callback: F) -> u64 |
| 100 | where |