diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-02-18 14:50:14 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-02-18 14:50:14 -0800 |
commit | 8a287d1a1bfbc2250abe43aa433397f68d07a632 (patch) | |
tree | 6b32636acbee57c60a7a098248774289576cadfe /src/cpp/client | |
parent | 1ff680a545c0212008bb568f198c91b48a27df89 (diff) | |
parent | 68bc778b63c1e82ec8c68cf9e2b9be23c0b9104d (diff) |
Merge pull request #588 from yang-g/c++api
Async client api change. Add a ClientAsyncResponseReader.
Diffstat (limited to 'src/cpp/client')
-rw-r--r-- | src/cpp/client/client_unary_call.cc | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/cpp/client/client_unary_call.cc b/src/cpp/client/client_unary_call.cc index 8fdd483474..08491f40f7 100644 --- a/src/cpp/client/client_unary_call.cc +++ b/src/cpp/client/client_unary_call.cc @@ -60,30 +60,4 @@ Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, GPR_ASSERT((cq.Pluck(&buf) && buf.got_message) || !status.IsOk()); return status; } - -class ClientAsyncRequest final : public CallOpBuffer { - public: - void FinalizeResult(void **tag, bool *status) override { - CallOpBuffer::FinalizeResult(tag, status); - delete this; - } -}; - -void AsyncUnaryCall(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - const google::protobuf::Message &request, - google::protobuf::Message *result, Status *status, - CompletionQueue *cq, void *tag) { - ClientAsyncRequest *buf = new ClientAsyncRequest; - buf->Reset(tag); - Call call(channel->CreateCall(method, context, cq)); - buf->AddSendInitialMetadata(context); - buf->AddSendMessage(request); - buf->AddRecvInitialMetadata(context); - buf->AddRecvMessage(result); - buf->AddClientSendClose(); - buf->AddClientRecvStatus(context, status); - call.PerformOps(buf); -} - } // namespace grpc |