aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/client_async.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/qps/client_async.cc')
-rw-r--r--test/cpp/qps/client_async.cc19
1 files changed, 6 insertions, 13 deletions
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index 0bd0f176a8..9ea9cfe8b9 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -105,24 +105,17 @@ class ClientRpcContext {
}
virtual void report_stats(gpr_histogram *hist) = 0;
};
-
-template <class RequestType, class ResponseType>
-using StartMethod = std::function<
- std::unique_ptr<grpc::ClientAsyncResponseReader
- <ResponseType>>(TestService::Stub *, grpc::ClientContext *,
- const RequestType &, void *)> ;
-
-template <class ResponseType> using DoneMethod =
- std::function<void(grpc::Status, ResponseType *)>;
-
template <class RequestType, class ResponseType>
class ClientRpcContextUnaryImpl : public ClientRpcContext {
public:
ClientRpcContextUnaryImpl(
TestService::Stub *stub,
const RequestType &req,
- StartMethod<RequestType,ResponseType> start_req,
- DoneMethod<ResponseType> on_done)
+ std::function<
+ std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>(
+ TestService::Stub *, grpc::ClientContext *, const RequestType &,
+ void *)> start_req,
+ std::function<void(grpc::Status, ResponseType *)> on_done)
: context_(),
stub_(stub),
req_(req),
@@ -157,7 +150,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext {
RequestType req_;
ResponseType response_;
bool (ClientRpcContextUnaryImpl::*next_state_)();
- DoneMethod<ResponseType> callback_;
+ std::function<void(grpc::Status, ResponseType *)> callback_;
grpc::Status status_;
double start_;
std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>