1 /* 2 * 3 * Copyright 2019 gRPC authors. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19 #ifndef TEST_CPP_MICROBENCHMARKS_CALLBACK_TEST_SERVICE_H 20 #define TEST_CPP_MICROBENCHMARKS_CALLBACK_TEST_SERVICE_H 21 22 #include <benchmark/benchmark.h> 23 #include <condition_variable> 24 #include <memory> 25 #include <mutex> 26 #include <sstream> 27 #include "src/proto/grpc/testing/echo.grpc.pb.h" 28 #include "test/cpp/util/string_ref_helper.h" 29 30 namespace grpc { 31 namespace testing { 32 33 const char* const kServerMessageSize = "server_message_size"; 34 35 class CallbackStreamingTestService 36 : public EchoTestService::ExperimentalCallbackService { 37 public: CallbackStreamingTestService()38 CallbackStreamingTestService() {} 39 40 experimental::ServerUnaryReactor* Echo( 41 experimental::CallbackServerContext* context, const EchoRequest* request, 42 EchoResponse* response) override; 43 44 experimental::ServerBidiReactor<EchoRequest, EchoResponse>* BidiStream( 45 experimental::CallbackServerContext* context) override; 46 }; 47 } // namespace testing 48 } // namespace grpc 49 #endif // TEST_CPP_MICROBENCHMARKS_CALLBACK_TEST_SERVICE_H 50