aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl/client_unary_call.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-01-28 16:00:40 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-01-28 16:00:40 -0800
commit6c3de35d3d233bb9b71d36a06f0f3282ce280359 (patch)
treed49d213cee44e67fd3413ab6eed386ec1994298c /include/grpc++/impl/client_unary_call.h
parent822602cff0f3b1f8373ac06a8ab8fe9792b1037e (diff)
parentdcc99a24eab23e42b63593c9a45e0e7e1392c49b (diff)
Merge pull request #4775 from dgquintas/sync-async-plus-interfaces
Support mixing sync and async method in the same service + Separation of core from proto compiler output
Diffstat (limited to 'include/grpc++/impl/client_unary_call.h')
-rw-r--r--include/grpc++/impl/client_unary_call.h39
1 files changed, 2 insertions, 37 deletions
diff --git a/include/grpc++/impl/client_unary_call.h b/include/grpc++/impl/client_unary_call.h
index 4cdc800267..abe321eacc 100644
--- a/include/grpc++/impl/client_unary_call.h
+++ b/include/grpc++/impl/client_unary_call.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -34,41 +34,6 @@
#ifndef GRPCXX_IMPL_CLIENT_UNARY_CALL_H
#define GRPCXX_IMPL_CLIENT_UNARY_CALL_H
-#include <grpc++/impl/call.h>
-#include <grpc++/support/config.h>
-#include <grpc++/support/status.h>
-
-namespace grpc {
-
-class Channel;
-class ClientContext;
-class CompletionQueue;
-class RpcMethod;
-
-// Wrapper that performs a blocking unary call
-template <class InputMessage, class OutputMessage>
-Status BlockingUnaryCall(Channel* channel, const RpcMethod& method,
- ClientContext* context, const InputMessage& request,
- OutputMessage* result) {
- CompletionQueue cq;
- Call call(channel->CreateCall(method, context, &cq));
- CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
- CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
- CallOpClientSendClose, CallOpClientRecvStatus> ops;
- Status status = ops.SendMessage(request);
- if (!status.ok()) {
- return status;
- }
- ops.SendInitialMetadata(context->send_initial_metadata_);
- ops.RecvInitialMetadata(context);
- ops.RecvMessage(result);
- ops.ClientSendClose();
- ops.ClientRecvStatus(context, &status);
- call.PerformOps(&ops);
- GPR_ASSERT((cq.Pluck(&ops) && ops.got_message) || !status.ok());
- return status;
-}
-
-} // namespace grpc
+#include <grpc++/impl/codegen/client_unary_call.h>
#endif // GRPCXX_IMPL_CLIENT_UNARY_CALL_H