34 #ifndef GRPCXX_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
35 #define GRPCXX_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
47 class CompletionQueue;
51 template <
class InputMessage,
class OutputMessage>
54 OutputMessage* result) {
58 Call call(channel->CreateCall(method, context, &cq));
63 Status status = ops.SendMessage(request);
67 ops.SendInitialMetadata(context->send_initial_metadata_,
68 context->initial_metadata_flags());
69 ops.RecvInitialMetadata(context);
70 ops.RecvMessage(result);
71 ops.ClientSendClose();
72 ops.ClientRecvStatus(context, &status);
73 call.PerformOps(&ops);
75 if (!ops.got_message && status.
ok()) {
77 "No message returned for unary request");
87 #endif // GRPCXX_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:137
#define GRPC_CQ_CURRENT_VERSION
Definition: grpc_types.h:601
Definition: grpc_types.h:602
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:168
Events are popped out by calling grpc_completion_queue_pluck() API ONLY.
Definition: grpc_types.h:598
Straightforward wrapping of the C call object.
Definition: call.h:638
Codegen interface for grpc::Channel.
Definition: channel_interface.h:64
Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, ClientContext *context, const InputMessage &request, OutputMessage *result)
Wrapper that performs a blocking unary call.
Definition: client_unary_call.h:52
The completion queue will have an associated pollset and there is no restriction on the type of file ...
Definition: grpc_types.h:578
Primary implementaiton of CallOpSetInterface.
Definition: call.h:583
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue.h:101
Descriptor of an RPC method.
Definition: rpc_method.h:44
bool ok() const
Is the status OK?
Definition: status.h:76
Did it work? If it didn't, why?
Definition: status.h:45
Operation is not implemented or not supported/enabled in this service.
Definition: status_code_enum.h:130