callback_test_service.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #ifndef TEST_CPP_MICROBENCHMARKS_CALLBACK_TEST_SERVICE_H
  19. #define TEST_CPP_MICROBENCHMARKS_CALLBACK_TEST_SERVICE_H
  20. #include <condition_variable>
  21. #include <memory>
  22. #include <mutex>
  23. #include <sstream>
  24. #include <benchmark/benchmark.h>
  25. #include "src/proto/grpc/testing/echo.grpc.pb.h"
  26. #include "test/cpp/util/string_ref_helper.h"
  27. namespace grpc {
  28. namespace testing {
  29. const char* const kServerMessageSize = "server_message_size";
  30. class CallbackStreamingTestService : public EchoTestService::CallbackService {
  31. public:
  32. CallbackStreamingTestService() {}
  33. ServerUnaryReactor* Echo(CallbackServerContext* context,
  34. const EchoRequest* request,
  35. EchoResponse* response) override;
  36. ServerBidiReactor<EchoRequest, EchoResponse>* BidiStream(
  37. CallbackServerContext* context) override;
  38. };
  39. } // namespace testing
  40. } // namespace grpc
  41. #endif // TEST_CPP_MICROBENCHMARKS_CALLBACK_TEST_SERVICE_H