Resolve "Support waiting for a transfer request to complete"
requested to merge amiranda/10-support-waiting-for-a-transfer-request-to-complete-via-std-future into main
This MR enables Cargo to keep track of transfer status so that it can be reported back to users.
It also extends the Cargo API as follows:
- Adds a new API function
transfer_dataset()
as a convenience function to request the transfer of a single dataset. - Adds a
cargo::transfer_state
enum with appropriate values that reflect a transfer's current status. - Adds a
cargo::transfer_status
class with functionsstate()
,done()
,failed()
anderror()
to retrieve a transfer's current status and its associated error condition in case of failure. - Extends the existing
cargo::transfer
class with functionswait()
, andwait_for()
, to wait for the completion of a transfer request. - Promotes
cargo::error_code
fromenum
to aclass
to allow for more expressiveness of error conditions. - Adds new error codes:
no_such_transfer
andtransfer_in_progress
. - Adds new formatters:
cargo::transfer_state
andstd::optional<T>
.
Closes #10 (closed)
Edited by Alberto Miranda