|
|
|
@ -96,8 +96,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { |
|
|
|
|
std::function< |
|
|
|
|
std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>( |
|
|
|
|
BenchmarkService::Stub*, grpc::ClientContext*, const RequestType&, |
|
|
|
|
CompletionQueue*)> |
|
|
|
|
start_req, |
|
|
|
|
CompletionQueue*)> start_req, |
|
|
|
|
std::function<void(grpc::Status, ResponseType*)> on_done) |
|
|
|
|
: ClientRpcContext(channel_id), |
|
|
|
|
context_(), |
|
|
|
@ -143,8 +142,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { |
|
|
|
|
std::function<void(grpc::Status, ResponseType*)> callback_; |
|
|
|
|
std::function<std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>( |
|
|
|
|
BenchmarkService::Stub*, grpc::ClientContext*, const RequestType&, |
|
|
|
|
CompletionQueue*)> |
|
|
|
|
start_req_; |
|
|
|
|
CompletionQueue*)> start_req_; |
|
|
|
|
grpc::Status status_; |
|
|
|
|
double start_; |
|
|
|
|
std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>> |
|
|
|
@ -164,12 +162,11 @@ class AsyncClient : public ClientImpl<StubType, RequestType> { |
|
|
|
|
using ClientImpl<StubType, RequestType>::cores_; |
|
|
|
|
using ClientImpl<StubType, RequestType>::channels_; |
|
|
|
|
using ClientImpl<StubType, RequestType>::request_; |
|
|
|
|
AsyncClient( |
|
|
|
|
const ClientConfig& config, |
|
|
|
|
std::function<ClientRpcContext*(int, StubType*, const RequestType&)> |
|
|
|
|
setup_ctx, |
|
|
|
|
std::function<std::unique_ptr<StubType>(std::shared_ptr<Channel>)> |
|
|
|
|
create_stub) |
|
|
|
|
AsyncClient(const ClientConfig& config, |
|
|
|
|
std::function<ClientRpcContext*(int, StubType*, |
|
|
|
|
const RequestType&)> setup_ctx, |
|
|
|
|
std::function<std::unique_ptr<StubType>(std::shared_ptr<Channel>)> |
|
|
|
|
create_stub) |
|
|
|
|
: ClientImpl<StubType, RequestType>(config, create_stub), |
|
|
|
|
num_async_threads_(NumThreads(config)), |
|
|
|
|
channel_lock_(new std::mutex[config.client_channels()]), |
|
|
|
@ -411,8 +408,7 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext { |
|
|
|
|
std::function<std::unique_ptr< |
|
|
|
|
grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>( |
|
|
|
|
BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*, |
|
|
|
|
void*)> |
|
|
|
|
start_req, |
|
|
|
|
void*)> start_req, |
|
|
|
|
std::function<void(grpc::Status, ResponseType*)> on_done) |
|
|
|
|
: ClientRpcContext(channel_id), |
|
|
|
|
context_(), |
|
|
|
@ -464,10 +460,10 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext { |
|
|
|
|
ResponseType response_; |
|
|
|
|
bool (ClientRpcContextStreamingImpl::*next_state_)(bool, Histogram*); |
|
|
|
|
std::function<void(grpc::Status, ResponseType*)> callback_; |
|
|
|
|
std::function<std::unique_ptr< |
|
|
|
|
grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>( |
|
|
|
|
BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*, void*)> |
|
|
|
|
start_req_; |
|
|
|
|
std::function< |
|
|
|
|
std::unique_ptr<grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>( |
|
|
|
|
BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*, |
|
|
|
|
void*)> start_req_; |
|
|
|
|
grpc::Status status_; |
|
|
|
|
double start_; |
|
|
|
|
std::unique_ptr<grpc::ClientAsyncReaderWriter<RequestType, ResponseType>> |
|
|
|
@ -511,8 +507,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext { |
|
|
|
|
int channel_id, grpc::GenericStub* stub, const ByteBuffer& req, |
|
|
|
|
std::function<std::unique_ptr<grpc::GenericClientAsyncReaderWriter>( |
|
|
|
|
grpc::GenericStub*, grpc::ClientContext*, |
|
|
|
|
const grpc::string& method_name, CompletionQueue*, void*)> |
|
|
|
|
start_req, |
|
|
|
|
const grpc::string& method_name, CompletionQueue*, void*)> start_req, |
|
|
|
|
std::function<void(grpc::Status, ByteBuffer*)> on_done) |
|
|
|
|
: ClientRpcContext(channel_id), |
|
|
|
|
context_(), |
|
|
|
@ -569,8 +564,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext { |
|
|
|
|
std::function<void(grpc::Status, ByteBuffer*)> callback_; |
|
|
|
|
std::function<std::unique_ptr<grpc::GenericClientAsyncReaderWriter>( |
|
|
|
|
grpc::GenericStub*, grpc::ClientContext*, const grpc::string&, |
|
|
|
|
CompletionQueue*, void*)> |
|
|
|
|
start_req_; |
|
|
|
|
CompletionQueue*, void*)> start_req_; |
|
|
|
|
grpc::Status status_; |
|
|
|
|
double start_; |
|
|
|
|
std::unique_ptr<grpc::GenericClientAsyncReaderWriter> stream_; |
|
|
|
|