Method
subscribe
(&self, sender: Sender<Event<K, Doc>>)
Source from the content-addressed store, hash-verified
| 107 | /// subscribe to Reporter |
| 108 | #[inline] |
| 109 | pub async fn subscribe(&self, sender: Sender<Event<K, Doc>>) -> Result<(), SessionResult> { |
| 110 | if self.off_reporter { |
| 111 | return Err(SessionResult::Err(StatusResult::ReporterIsOff)); |
| 112 | } |
| 113 | |
| 114 | // Send to Reporter |
| 115 | let _ = self |
| 116 | .reporter_session |
| 117 | .dispatch(Event::Subscribed(sender.clone())) |
| 118 | .await; |
| 119 | |
| 120 | self.reporter_session.register(sender).await |
| 121 | } |
| 122 | |
| 123 | /// insert to storage and persist to disk |
| 124 | #[inline] |
Tested by
no test coverage detected