|
|
@ -52,7 +52,8 @@ class TemplatedGenericStub final { |
|
|
|
/// start it. Let it be started explicitly with StartCall and a tag.
|
|
|
|
/// start it. Let it be started explicitly with StartCall and a tag.
|
|
|
|
/// The return value only indicates whether or not registration of the call
|
|
|
|
/// The return value only indicates whether or not registration of the call
|
|
|
|
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
|
|
|
|
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
|
|
|
|
std::unique_ptr<::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>> |
|
|
|
std::unique_ptr< |
|
|
|
|
|
|
|
::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>> |
|
|
|
PrepareCall(ClientContext* context, const std::string& method, |
|
|
|
PrepareCall(ClientContext* context, const std::string& method, |
|
|
|
::grpc_impl::CompletionQueue* cq) { |
|
|
|
::grpc_impl::CompletionQueue* cq) { |
|
|
|
return CallInternal(channel_.get(), context, method, cq, false, nullptr); |
|
|
|
return CallInternal(channel_.get(), context, method, cq, false, nullptr); |
|
|
@ -62,15 +63,18 @@ class TemplatedGenericStub final { |
|
|
|
/// start it. Let it be started explicitly with StartCall.
|
|
|
|
/// start it. Let it be started explicitly with StartCall.
|
|
|
|
/// The return value only indicates whether or not registration of the call
|
|
|
|
/// The return value only indicates whether or not registration of the call
|
|
|
|
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
|
|
|
|
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
|
|
|
|
std::unique_ptr<::grpc_impl::ClientAsyncResponseReader<ResponseType>> PrepareUnaryCall( |
|
|
|
std::unique_ptr<::grpc_impl::ClientAsyncResponseReader<ResponseType>> |
|
|
|
ClientContext* context, const std::string& method, |
|
|
|
PrepareUnaryCall(ClientContext* context, const std::string& method, |
|
|
|
const RequestType& request, ::grpc_impl::CompletionQueue* cq) { |
|
|
|
const RequestType& request, |
|
|
|
return std::unique_ptr<::grpc_impl::ClientAsyncResponseReader<ResponseType>>( |
|
|
|
::grpc_impl::CompletionQueue* cq) { |
|
|
|
grpc_impl::internal::ClientAsyncResponseReaderFactory<ResponseType>::Create( |
|
|
|
return std::unique_ptr< |
|
|
|
channel_.get(), cq, |
|
|
|
::grpc_impl::ClientAsyncResponseReader<ResponseType>>( |
|
|
|
grpc::internal::RpcMethod(method.c_str(), |
|
|
|
grpc_impl::internal::ClientAsyncResponseReaderFactory< |
|
|
|
|
|
|
|
ResponseType>::Create(channel_.get(), cq, |
|
|
|
|
|
|
|
grpc::internal::RpcMethod( |
|
|
|
|
|
|
|
method.c_str(), |
|
|
|
grpc::internal::RpcMethod::NORMAL_RPC), |
|
|
|
grpc::internal::RpcMethod::NORMAL_RPC), |
|
|
|
context, request, false)); |
|
|
|
context, request, false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// DEPRECATED for multi-threaded use
|
|
|
|
/// DEPRECATED for multi-threaded use
|
|
|
@ -79,9 +83,10 @@ class TemplatedGenericStub final { |
|
|
|
/// (i.e, initial metadata has been sent).
|
|
|
|
/// (i.e, initial metadata has been sent).
|
|
|
|
/// The return value only indicates whether or not registration of the call
|
|
|
|
/// The return value only indicates whether or not registration of the call
|
|
|
|
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
|
|
|
|
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
|
|
|
|
std::unique_ptr<::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>> Call( |
|
|
|
std::unique_ptr< |
|
|
|
ClientContext* context, const std::string& method, ::grpc_impl::CompletionQueue* cq, |
|
|
|
::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>> |
|
|
|
void* tag) { |
|
|
|
Call(ClientContext* context, const std::string& method, |
|
|
|
|
|
|
|
::grpc_impl::CompletionQueue* cq, void* tag) { |
|
|
|
return CallInternal(channel_.get(), context, method, cq, true, tag); |
|
|
|
return CallInternal(channel_.get(), context, method, cq, true, tag); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -178,7 +183,8 @@ class TemplatedGenericStub final { |
|
|
|
const RequestType* request, |
|
|
|
const RequestType* request, |
|
|
|
ResponseType* response, |
|
|
|
ResponseType* response, |
|
|
|
::grpc_impl::ClientUnaryReactor* reactor) { |
|
|
|
::grpc_impl::ClientUnaryReactor* reactor) { |
|
|
|
::grpc_impl::internal::ClientCallbackUnaryFactory::Create<RequestType, ResponseType>( |
|
|
|
::grpc_impl::internal::ClientCallbackUnaryFactory::Create<RequestType, |
|
|
|
|
|
|
|
ResponseType>( |
|
|
|
channel_.get(), |
|
|
|
channel_.get(), |
|
|
|
grpc::internal::RpcMethod(method.c_str(), |
|
|
|
grpc::internal::RpcMethod(method.c_str(), |
|
|
|
grpc::internal::RpcMethod::NORMAL_RPC), |
|
|
|
grpc::internal::RpcMethod::NORMAL_RPC), |
|
|
@ -188,20 +194,23 @@ class TemplatedGenericStub final { |
|
|
|
void PrepareBidiStreamingCallInternal( |
|
|
|
void PrepareBidiStreamingCallInternal( |
|
|
|
ClientContext* context, const std::string& method, |
|
|
|
ClientContext* context, const std::string& method, |
|
|
|
::grpc_impl::ClientBidiReactor<RequestType, ResponseType>* reactor) { |
|
|
|
::grpc_impl::ClientBidiReactor<RequestType, ResponseType>* reactor) { |
|
|
|
::grpc_impl::internal::ClientCallbackReaderWriterFactory<RequestType, ResponseType>:: |
|
|
|
::grpc_impl::internal:: |
|
|
|
Create(channel_.get(), |
|
|
|
ClientCallbackReaderWriterFactory<RequestType, ResponseType>::Create( |
|
|
|
grpc::internal::RpcMethod( |
|
|
|
channel_.get(), |
|
|
|
method.c_str(), grpc::internal::RpcMethod::BIDI_STREAMING), |
|
|
|
grpc::internal::RpcMethod( |
|
|
|
context, reactor); |
|
|
|
method.c_str(), grpc::internal::RpcMethod::BIDI_STREAMING), |
|
|
|
|
|
|
|
context, reactor); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>> |
|
|
|
std::unique_ptr< |
|
|
|
|
|
|
|
::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>> |
|
|
|
CallInternal(grpc::ChannelInterface* channel, ClientContext* context, |
|
|
|
CallInternal(grpc::ChannelInterface* channel, ClientContext* context, |
|
|
|
const std::string& method, ::grpc_impl::CompletionQueue* cq, bool start, |
|
|
|
const std::string& method, ::grpc_impl::CompletionQueue* cq, |
|
|
|
void* tag) { |
|
|
|
bool start, void* tag) { |
|
|
|
return std::unique_ptr<::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>>( |
|
|
|
return std::unique_ptr< |
|
|
|
::grpc_impl::internal::ClientAsyncReaderWriterFactory<RequestType, ResponseType>:: |
|
|
|
::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>>( |
|
|
|
Create( |
|
|
|
::grpc_impl::internal:: |
|
|
|
|
|
|
|
ClientAsyncReaderWriterFactory<RequestType, ResponseType>::Create( |
|
|
|
channel, cq, |
|
|
|
channel, cq, |
|
|
|
grpc::internal::RpcMethod( |
|
|
|
grpc::internal::RpcMethod( |
|
|
|
method.c_str(), grpc::internal::RpcMethod::BIDI_STREAMING), |
|
|
|
method.c_str(), grpc::internal::RpcMethod::BIDI_STREAMING), |
|
|
|