Page MenuHomePhabricator

[DRAFT] [services] Backup - Connect to Blob - Use Result
AbandonedPublic

Authored by karol on Aug 24 2022, 5:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 4, 7:06 PM
Unknown Object (File)
Nov 10 2024, 6:58 AM
Unknown Object (File)
Oct 27 2024, 8:11 PM
Unknown Object (File)
Oct 27 2024, 8:11 PM
Unknown Object (File)
Oct 27 2024, 8:09 PM
Unknown Object (File)
Oct 14 2024, 6:03 PM
Unknown Object (File)
Oct 8 2024, 8:30 PM
Unknown Object (File)
Oct 3 2024, 4:18 PM

Details

Summary

Depends on D4944

I discovered that I can just use Result in Rust and catch std::exception in c++

Test Plan

Test plan in D4946

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

karol retitled this revision from [services] Backup - Connect to Blob - Use Result to [DRAFT] [services] Backup - Connect to Blob - Use Result.Aug 24 2022, 6:04 AM
karol edited the summary of this revision. (Show Details)
karol edited the test plan for this revision. (Show Details)
karol added reviewers: varun, tomek.
tomek requested changes to this revision.Aug 29 2022, 4:59 AM
tomek added inline comments.
services/backup/blob_client/src/put_client.rs
114

Why do we assign here? Can't we just return the value? https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html#method.block_on

This runs the given future on the current thread, blocking until it is complete, and yielding its resolved result.

149

Why this function doesn't need to call check_error?

This revision now requires changes to proceed.Aug 29 2022, 4:59 AM

update

services/backup/blob_client/src/put_client.rs
114

This is nice, but we should assign since we have to reassign client.rx in the end eventually. So, if we wanted to return from the block_on, we'd have to have an internal variable in the async block anyway.

149

It should call it

Abandoning this stack in favor of the new one that starts @ D5002.

All the comments have been either addressed inline or in the new stack.