Skip to content

Commit c66adb5

Browse files
committed
fix grpc-proto-structs: fix grpc-proto-structs client ResponseFuture
commit_hash:8b8f1f425a24cfba23e06d1abba2dead4a7ae82e
1 parent 47de54b commit c66adb5

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

libraries/grpc-proto-structs/include/userver/grpc-proto-structs/client/response_future.hpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class ResponseFuture final {
2525
/// @brief Checks if the asynchronous call has completed.
2626
/// Note, that once user gets result, IsReady should not be called.
2727
/// @return true if result ready.
28-
[[nodiscard]] bool IsReady() const { return future_->IsReady(); }
28+
[[nodiscard]] bool IsReady() const { return future_.IsReady(); }
2929

3030
/// @brief Await response until specified timepoint.
3131
///
3232
/// @throws ugrpc::client::RpcError on an RPC error.
3333
[[nodiscard]] engine::FutureStatus WaitUntil(engine::Deadline deadline) const noexcept {
34-
return future_->WaitUntil(deadline);
34+
return future_.WaitUntil(deadline);
3535
}
3636

3737
/// @brief Await and read the response.
@@ -43,19 +43,16 @@ class ResponseFuture final {
4343
/// @returns the response on success.
4444
/// @throws ugrpc::client::RpcError on an RPC error.
4545
/// @throws ugrpc::client::RpcCancelledError on task cancellation.
46-
Response Get() {
47-
const auto response = future_->Get();
48-
return proto_structs::MessageToStruct(response);
49-
}
46+
Response Get() { return proto_structs::MessageToStruct<Response>(future_.Get()); }
5047

5148
/// @brief Cancel call.
52-
void Cancel() { return future_->Cancel(); }
49+
void Cancel() { return future_.Cancel(); }
5350

5451
/// @brief Get call context, useful e.g. for accessing metadata.
55-
ugrpc::client::CallContext& GetContext() { return future_->GetContext(); }
52+
ugrpc::client::CallContext& GetContext() { return future_.GetContext(); }
5653

5754
/// @overload
58-
const ugrpc::client::CallContext& GetContext() const { return future_->GetContext(); }
55+
const ugrpc::client::CallContext& GetContext() const { return future_.GetContext(); }
5956

6057
private:
6158
VanillaFuture future_;

0 commit comments

Comments
 (0)