Skip to main content

coven/
handle_transfers.rs

1//! How far each file in flight has got, by file (E7, E8): progress this
2//! process holds in memory, beside the views that say which files are in
3//! flight.
4use crate::*;
5
6impl CovenHandle {
7    /// How far each file this process is sending has got, by file: every
8    /// one being sent first, then each change as its bytes go, until the
9    /// store closes (E7). The files are the ones `coven_sending` lists.
10    pub fn subscribe_upload_transfers(&self) -> TransferWatch {
11        self.database.uploads_in_flight().subscribe()
12    }
13
14    /// How far each file this process is downloading to keep whole has got,
15    /// by file, for a pin: every one being downloaded first,
16    /// then each change as its bytes arrive, until the store closes (E8).
17    /// The files are the ones `coven_downloading` lists.
18    pub fn subscribe_download_transfers(&self) -> TransferWatch {
19        self.database.downloads_in_flight().subscribe()
20    }
21}
22
23#[cfg(test)]
24#[path = "handle_transfers_tests.rs"]
25mod tests;