-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make export a seperate operation from download (#2113)
## Description This changes two things about how we expose Iroh in the RPC API: * Add `iroh.blobs.export()` / `BlobExportRequest` to export a blob from the internal blob store to the local filesystem. We prominently missed this in our API. * Add `blob export` to the CLI. The CLI also keeps the "export after download" functionality, it just issues a second RPC request for the export now. * Remove the `out: DownloadLocation` field from `BlobDownloadRequest` and thus the functionality to automatically export a blob after the download finishes. Instead, users may call `iroh.blobs.export` themselves now after the download finishes. This does not make a difference performance-wise (apart from a single RPC roundtrip), because the export operation was already running sequentially after the download before this PR. The untangling of export and download will simplify #2085 quite a bit, because at the moment the fact that the export progress events were emitted from outside the downloader introduced a complication in how we can emit progress events from the downloader (we had to remap the progress IDs to avoid conflicts). With this change, a download will only get progress event from the download itself, so this is solved much more simple. ## Notes & open questions There's no progress reporting for the CLI yet. But we also didn't have that before, so I think it's fine to do as a followup. ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [ ] Tests if relevant.
- Loading branch information
Showing
9 changed files
with
306 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.