5#include <google/rpc/status.pb.h>
6#include <grpcpp/client_context.h>
7#include <grpcpp/impl/codegen/status.h>
9#include <userver/engine/deadline.hpp>
11#include <userver/ugrpc/impl/async_method_invocation.hpp>
13USERVER_NAMESPACE_BEGIN
15namespace ugrpc::
client::impl {
21struct ParsedGStatus
final {
23 static ParsedGStatus ProcessStatus(
const grpc::Status& status);
25 std::optional<google::rpc::Status> gstatus;
26 std::optional<std::string> gstatus_string;
31class FinishAsyncMethodInvocation
final
32 :
public ugrpc::impl::AsyncMethodInvocation {
34 explicit FinishAsyncMethodInvocation(RpcData& rpc_data);
35 ~FinishAsyncMethodInvocation()
override;
37 grpc::Status& GetStatus();
38 ParsedGStatus& GetParsedGStatus();
40 void Notify(
bool ok)
noexcept override;
44 grpc::Status& status_;
45 ParsedGStatus parsed_gstatus_;
48ugrpc::impl::AsyncMethodInvocation::WaitStatus Wait(
49 ugrpc::impl::AsyncMethodInvocation& invocation,
50 grpc::ClientContext& context)
noexcept;
52ugrpc::impl::AsyncMethodInvocation::WaitStatus WaitUntil(
53 ugrpc::impl::AsyncMethodInvocation& invocation,
54 grpc::ClientContext& context, engine::Deadline deadline)
noexcept;