Skip to content

Commit 49d4f60

Browse files
downloader: Add method to wait for status updates
1 parent 3fe1e92 commit 49d4f60

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/downloader.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ impl DownloadHandle {
5454
*self.status.borrow()
5555
}
5656

57+
pub async fn wait_for_status_update(&mut self) -> Result<(), watch::error::RecvError> {
58+
self.status.changed().await
59+
}
60+
5761
pub fn cancel(self) {
5862
self.cancel.send(()).ok();
5963
}

0 commit comments

Comments
 (0)