We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce05710 commit 633b752Copy full SHA for 633b752
src/downloader/manager.rs
@@ -88,6 +88,23 @@ impl DownloadManager {
88
pub fn cancel_all(&self) {
89
self.cancel.cancel();
90
}
91
+
92
+ pub fn queued_downloads(&self) -> usize {
93
+ self.queue.max_capacity() - self.queue.capacity()
94
+ }
95
96
+ pub fn active_downloads(&self) -> usize {
97
+ // -1 because the dispatcher thread is always running
98
+ self.tracker.len() - 1
99
100
101
+ pub async fn shutdown(self) -> Result<(), Error> {
102
+ self.cancel.cancel();
103
+ self.tracker.close();
104
+ self.tracker.wait().await;
105
+ drop(self.queue);
106
+ Ok(())
107
108
109
110
async fn dispatcher_thread(
0 commit comments