34 #ifndef GRPCXX_IMPL_CLIENT_UNARY_CALL_H
35 #define GRPCXX_IMPL_CLIENT_UNARY_CALL_H
45 class CompletionQueue;
49 template <
class InputMessage,
class OutputMessage>
52 OutputMessage* result) {
54 Call call(channel->CreateCall(method, context, &cq));
58 Status status = ops.SendMessage(request);
62 ops.SendInitialMetadata(context->send_initial_metadata_);
63 ops.RecvInitialMetadata(context);
64 ops.RecvMessage(result);
65 ops.ClientSendClose();
66 ops.ClientRecvStatus(context, &status);
67 call.PerformOps(&ops);
68 GPR_ASSERT((cq.Pluck(&ops) && ops.got_message) || !status.
ok());
74 #endif // GRPCXX_IMPL_CLIENT_UNARY_CALL_H
Status BlockingUnaryCall(Channel *channel, const RpcMethod &method, ClientContext *context, const InputMessage &request, OutputMessage *result)
Definition: client_unary_call.h:50
Definition: client_context.h:149
Primary implementaiton of CallOpSetInterface.
Definition: call.h:502
A thin wrapper around grpc_completion_queue (see / src/core/surface/completion_queue.h).
Definition: completion_queue.h:81
Definition: rpc_method.h:43
bool ok() const
Is the status OK?
Definition: status.h:67
Did it work? If it didn't, why?
Definition: status.h:45
Channels represent a connection to an endpoint. Created by CreateChannel.
Definition: channel.h:69