Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3365775
D5010.id16442.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5010.id16442.diff
View Options
diff --git a/services/backup/blob_client/src/put_client.rs b/services/backup/blob_client/src/put_client.rs
--- a/services/backup/blob_client/src/put_client.rs
+++ b/services/backup/blob_client/src/put_client.rs
@@ -176,7 +176,28 @@
}
pub fn put_client_blocking_read_cxx() -> Result<String, String> {
- unimplemented!();
+ check_error()?;
+ let response: Option<String> = RUNTIME.block_on(async {
+ if let Ok(mut maybe_client) = CLIENT.lock() {
+ if let Some(mut client) = (*maybe_client).take() {
+ if let Some(data) = client.rx.recv().await {
+ return Some(data);
+ } else {
+ report_error(
+ "couldn't receive data via client's receiver".to_string(),
+ );
+ }
+ *maybe_client = Some(client);
+ } else {
+ report_error("no client detected".to_string());
+ }
+ } else {
+ report_error("couldn't access client".to_string());
+ }
+ None
+ });
+ check_error()?;
+ response.ok_or("response not received properly".to_string())
}
/**
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 7:40 AM (22 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2583910
Default Alt Text
D5010.id16442.diff (1 KB)
Attached To
Mode
D5010: [services] Backup - Blob Put Client - Add blocking read
Attached
Detach File
Event Timeline
Log In to Comment