Start a sync loop in a new background thread. Takes ownership over the app. You can retain a Query instance before calling this.
(self)
| 209 | /// Start a sync loop in a new background thread. |
| 210 | /// Takes ownership over the app. You can retain a Query instance before calling this. |
| 211 | pub fn sync_background(self) -> mpsc::SyncSender<()> { |
| 212 | let (shutdown_tx, shutdown_rx) = mpsc::sync_channel(1); |
| 213 | thread::spawn(move || self.sync_loop(Some(shutdown_rx))); |
| 214 | shutdown_tx |
| 215 | } |
| 216 | |
| 217 | /// Get the sender for triggering a real-time index sync |
| 218 | pub fn sync_sender(&self) -> mpsc::Sender<()> { |