├── .bazelignore ├── .bazelrc ├── .clang-format ├── .github ├── .codecov.yml └── workflows │ ├── ci.yml │ └── cla.yml ├── .gitignore ├── BUILD ├── CHANGELOG.md ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CODE_OF_CONDUCT.zh_CN.md ├── CONTRIBUTING.md ├── CONTRIBUTING.zh_CN.md ├── CONTRIBUTORS.md ├── CONTRIBUTORS.zh_CN.md ├── DEVELOP_SPECIFICATIONS.md ├── DEVELOP_SPECIFICATIONS.zh_CN.md ├── LICENSE ├── README.md ├── README.zh_CN.md ├── WORKSPACE ├── build.sh ├── clean.sh ├── cmake ├── README.md ├── config │ └── trpc_config.cmake ├── flatbuffers.cmake ├── fmt.cmake ├── gflags.cmake ├── gtest_gmock.cmake ├── jsoncpp.cmake ├── jwt_cpp.cmake ├── lz4.cmake ├── nghttp2.cmake ├── picohttpparser.cmake ├── prometheus.cmake ├── protobuf.cmake ├── rapidjson.cmake ├── snappy.cmake ├── spdlog.cmake ├── toml11.cmake ├── tools │ ├── copy_fmt_to_spdlog.sh │ ├── flatbuffers_CMakeLists.txt │ ├── sed_gflags.sh │ ├── shared_lib_pack.sh │ ├── static_lib_pack.sh │ └── trpc_utils.cmake ├── trpc_protocol.cmake └── yaml.cmake ├── docker ├── dockerfile-gcc7 └── dockerfile-gcc8 ├── docs ├── README.md ├── README.zh_CN.md ├── en │ ├── admin_service.md │ ├── architecture_design.md │ ├── attachment.md │ ├── backup_request.md │ ├── basic_tutorial.md │ ├── bazel_or_cmake.md │ ├── benchmark.md │ ├── client_guide.md │ ├── compression.md │ ├── custom_config.md │ ├── custom_logging.md │ ├── custom_metrics.md │ ├── custom_naming.md │ ├── custom_protocol.md │ ├── custom_telemetry.md │ ├── custom_tracing.md │ ├── fiber.md │ ├── fiber_faq.md │ ├── fiber_user_guide.md │ ├── filter.md │ ├── flatbuffers_protocol_client.md │ ├── flatbuffers_protocol_service.md │ ├── framework_config_full.md │ ├── framework_config_lite.md │ ├── future_promise_guide.md │ ├── grpc_protocol_client.md │ ├── grpc_protocol_service.md │ ├── grpc_protocol_streaming_service.md │ ├── http_protocol_client.md │ ├── http_protocol_service.md │ ├── http_protocol_upload_download_client.md │ ├── http_protocol_upload_download_service.md │ ├── local_logging.md │ ├── overload_control_concurrency_limiter.md │ ├── overload_control_fiber_limiter.md │ ├── overload_control_flow_limiter.md │ ├── overload_control_high_percentile.md │ ├── overview.md │ ├── pb_arena.md │ ├── plugin_management.md │ ├── prometheus_metrics.md │ ├── proto_management.md │ ├── quick_start.md │ ├── redis_client_guide.md │ ├── rpcz.md │ ├── runtime.md │ ├── serialization.md │ ├── server_guide.md │ ├── setup_env.md │ ├── timeout_control.md │ ├── transparent_service.md │ ├── trpc_protocol_client.md │ ├── trpc_protocol_service.md │ ├── trpc_protocol_streaming_client.md │ ├── trpc_protocol_streaming_service.md │ ├── trpc_status_code.md │ ├── tvar.md │ └── unit_testing.md ├── images │ ├── admin_main_page.png │ ├── analysis_of_token_availability_interval.svg │ ├── arch_design.png │ ├── backup_request.png │ ├── client_guide_invoke_routine_en.png │ ├── client_guide_invoke_routine_zh.png │ ├── concurrency_limiter.png │ ├── config_design.png │ ├── dir_structure.png │ ├── faq │ │ ├── client_invoke_error_code.png │ │ ├── crash_when_double_free.png │ │ ├── crash_when_port_conflict.png │ │ ├── crash_when_then_capture_raw_pointer.png │ │ ├── crash_when_throw_exectpion.png │ │ └── http_problem_wrong_usage.png │ ├── fiber_limiter.png │ ├── fiber_threadmodel_arch.png │ ├── filter.png │ ├── filter_point.png │ ├── flow_control_limiter.png │ ├── flow_control_limiter_second_1.png │ ├── flow_control_limiter_second_2.png │ ├── flow_control_limiter_smooth.png │ ├── future_promise_state_en.png │ ├── future_promise_state_zh.png │ ├── future_promise_structure_en.png │ ├── future_promise_structure_zh.png │ ├── high_percenttile_limiter.png │ ├── interaction_process.png │ ├── log_design.png │ ├── m_n_coroutine_en.png │ ├── m_n_coroutine_zh.png │ ├── merge_threadmodel_arch.png │ ├── plugin_factory.png │ ├── quick_start_helloworld.png │ ├── rpcz_client_filter_point_en.png │ ├── rpcz_client_filter_point_zh.png │ ├── rpcz_design_en.png │ ├── rpcz_design_zh.png │ ├── rpcz_perfetto.png │ ├── rpcz_sample_en.png │ ├── rpcz_sample_zh.png │ ├── rpcz_server_filter_point_en.png │ ├── rpcz_server_filter_point_zh.png │ ├── separate_threadmodel_arch.png │ ├── timeout_control.png │ ├── token_bucket_limiter.svg │ ├── tracing.png │ ├── transparent_service_en.png │ ├── transparent_service_zh.png │ ├── trpc_protocol_client-async.png │ ├── trpc_protocol_client-client.png │ ├── trpc_protocol_client-forword.png │ ├── trpc_protocol_client-rpc_interface.png │ ├── trpc_protocol_service_stub_en.png │ └── trpc_protocol_service_stub_zh.png └── zh │ ├── README.md │ ├── admin_service.md │ ├── architecture_design.md │ ├── attachment.md │ ├── backup_request.md │ ├── basic_tutorial.md │ ├── bazel_or_cmake.md │ ├── benchmark.md │ ├── client_guide.md │ ├── compression.md │ ├── custom_config.md │ ├── custom_logging.md │ ├── custom_metrics.md │ ├── custom_naming.md │ ├── custom_protocol.md │ ├── custom_telemetry.md │ ├── custom_tracing.md │ ├── faq.md │ ├── faq │ ├── bazel_and_cmake_problem.md │ ├── fiber_problem.md │ ├── future_promise_problem.md │ ├── http_promblem.md │ ├── log_problem.md │ ├── low_performance.md │ ├── program_crash.md │ ├── protobuf_and_proto_import_problem.md │ └── unexpected_cost_time.md │ ├── fiber.md │ ├── fiber_user_guide.md │ ├── filter.md │ ├── flatbuffers_protocol_client.md │ ├── flatbuffers_protocol_service.md │ ├── framework_config_full.md │ ├── framework_config_lite.md │ ├── future_promise_guide.md │ ├── grpc_protocol_client.md │ ├── grpc_protocol_service.md │ ├── grpc_protocol_streaming_service.md │ ├── hash_loadbalance.md │ ├── http_protocol_client.md │ ├── http_protocol_service.md │ ├── http_protocol_upload_download_client.md │ ├── http_protocol_upload_download_service.md │ ├── loadbalance_round_robin.md │ ├── local_logging.md │ ├── overload_control_concurrency_limiter.md │ ├── overload_control_fiber_limiter.md │ ├── overload_control_flow_limiter.md │ ├── overload_control_high_percentile.md │ ├── overload_control_token_bucket_limiter.md │ ├── overview.md │ ├── pb_arena.md │ ├── plugin_management.md │ ├── prometheus_metrics.md │ ├── proto_management.md │ ├── quick_start.md │ ├── redis_client_guide.md │ ├── rpcz.md │ ├── runtime.md │ ├── serialization.md │ ├── server_guide.md │ ├── setup_env.md │ ├── timeout_control.md │ ├── transparent_service.md │ ├── trpc_protocol_client.md │ ├── trpc_protocol_service.md │ ├── trpc_protocol_streaming_client.md │ ├── trpc_protocol_streaming_service.md │ ├── trpc_status_code.md │ ├── tvar.md │ ├── unit_testing.md │ └── window_limit_overload_control.md ├── doxygen └── Doxyfile ├── examples ├── README.md ├── features │ ├── README.md │ ├── admin │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp.yaml │ │ ├── proxy │ │ │ ├── BUILD │ │ │ ├── custom_conf.h │ │ │ ├── forward.proto │ │ │ ├── forward_server.cc │ │ │ ├── forward_service.cc │ │ │ ├── forward_service.h │ │ │ └── trpc_cpp.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ ├── cmake │ │ └── common.cmake │ ├── fiber_forward │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── proxy │ │ │ ├── BUILD │ │ │ ├── forward.proto │ │ │ ├── forward_server.cc │ │ │ ├── forward_server.h │ │ │ ├── forward_service.cc │ │ │ ├── forward_service.h │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ ├── filter │ │ ├── BUILD │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── demo_client.cc │ │ │ └── trpc_cpp_separate.yaml │ │ ├── common │ │ │ ├── BUILD │ │ │ ├── invoke_stat_filter.h │ │ │ └── user_rpc_filter.h │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── demo_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── future_forward │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_future.yaml │ │ ├── proxy │ │ │ ├── BUILD │ │ │ ├── forward.proto │ │ │ ├── forward_server.cc │ │ │ ├── forward_server.h │ │ │ ├── forward_service.cc │ │ │ ├── forward_service.h │ │ │ └── trpc_cpp_future.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ ├── grpc │ │ ├── README.md │ │ ├── client │ │ │ ├── trpc_cpp.yaml │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── trpc_cpp.yaml │ │ │ └── trpc_cpp_fiber.yaml │ ├── grpc_stream │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── common │ │ │ ├── BUILD │ │ │ ├── helper.cc │ │ │ ├── helper.h │ │ │ └── route_guide_db.json │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── stream.proto │ │ │ ├── stream_server.cc │ │ │ ├── stream_service.cc │ │ │ ├── stream_service.h │ │ │ └── trpc_cpp_fiber.yaml │ ├── http │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── http_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── http_async_upload_download │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── http_server.cc │ │ │ └── trpc_cpp_merge.yaml │ ├── http_rpc │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── http_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── http_upload_download │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── download_client.cc │ │ │ ├── trpc_cpp_fiber.yaml │ │ │ └── upload_client.cc │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── file_storage_handler.cc │ │ │ ├── file_storage_handler.h │ │ │ ├── http_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── https │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cert │ │ │ ├── README.md │ │ │ ├── client_ca_cert.pem │ │ │ ├── server_cert.pem │ │ │ ├── server_dhparam.pem │ │ │ └── server_key.pem │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── https_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── prometheus │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── proxy │ │ │ ├── BUILD │ │ │ ├── forward.proto │ │ │ ├── forward_server.cc │ │ │ ├── forward_service.cc │ │ │ ├── forward_service.h │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ ├── redis │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── fiber │ │ │ │ ├── BUILD │ │ │ │ ├── fiber_client.cc │ │ │ │ └── fiber_client_config.yaml │ │ │ └── future │ │ │ │ ├── BUILD │ │ │ │ ├── future_client.cc │ │ │ │ └── future_client_config.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ ├── request_dispatch │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── fiber_client.cc │ │ │ ├── future_client.cc │ │ │ ├── trpc_cpp_fiber.yaml │ │ │ └── trpc_cpp_future.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── demo_server.cc │ │ │ ├── trpc_cpp_fiber.yaml │ │ │ └── trpc_cpp_separate.yaml │ ├── rpcz │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_client.yaml │ │ ├── proxy │ │ │ ├── BUILD │ │ │ ├── rpcz.proto │ │ │ ├── rpcz_proxy.cc │ │ │ ├── rpcz_proxy.h │ │ │ └── trpc_cpp_proxy.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ ├── thirdparty_protocol │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── common │ │ │ ├── BUILD │ │ │ ├── demo_client_codec.cc │ │ │ ├── demo_client_codec.h │ │ │ ├── demo_protocol.cc │ │ │ ├── demo_protocol.h │ │ │ ├── demo_server_codec.cc │ │ │ └── demo_server_codec.h │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── demo_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── trpc_async_stream │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── stream_server.cc │ │ │ ├── stream_service.cc │ │ │ ├── stream_service.h │ │ │ └── trpc_cpp_merge.yaml │ ├── trpc_attachment │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── demo_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── trpc_compressor │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ ├── trpc_flatbuffers │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── proxy │ │ │ ├── BUILD │ │ │ ├── forward.fbs │ │ │ ├── forward_server.cc │ │ │ ├── forward_server.h │ │ │ ├── forward_service.cc │ │ │ ├── forward_service.h │ │ │ ├── greeter.fbs │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── demo_server.cc │ │ │ ├── demo_server.h │ │ │ ├── demo_service.cc │ │ │ ├── demo_service.h │ │ │ ├── greeter.fbs │ │ │ └── trpc_cpp_fiber.yaml │ ├── trpc_json │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── demo_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── trpc_noop │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── demo_server.cc │ │ │ └── trpc_cpp_fiber.yaml │ ├── trpc_stream │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ ├── rawdata_stream_client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ │ ├── BUILD │ │ │ ├── stream.proto │ │ │ ├── stream_server.cc │ │ │ ├── stream_service.cc │ │ │ ├── stream_service.h │ │ │ └── trpc_cpp_fiber.yaml │ ├── trpc_stream_forward │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── proxy │ │ │ ├── BUILD │ │ │ ├── stream_forward.proto │ │ │ ├── stream_forward_server.cc │ │ │ ├── stream_forward_service.cc │ │ │ ├── stream_forward_service.h │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ ├── trpc_transparent │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── client.cc │ │ │ └── trpc_cpp_fiber.yaml │ │ ├── proxy │ │ │ ├── BUILD │ │ │ ├── transparent_server.cc │ │ │ ├── transparent_server.h │ │ │ ├── transparent_service.cc │ │ │ ├── transparent_service.h │ │ │ ├── trpc_cpp_fiber.yaml │ │ │ └── trpc_cpp_future.yaml │ │ ├── run.sh │ │ └── run_cmake.sh │ └── tvar │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── client │ │ ├── BUILD │ │ ├── client.cc │ │ └── trpc_cpp_client.yaml │ │ ├── run.sh │ │ ├── run_cmake.sh │ │ └── server │ │ ├── BUILD │ │ ├── trpc_cpp_server.yaml │ │ ├── tvar.proto │ │ ├── tvar_server.cc │ │ └── tvar_server.h ├── helloworld │ ├── BUILD │ ├── CMakeLists.txt │ ├── README.md │ ├── conf │ │ ├── trpc_cpp.yaml │ │ └── trpc_cpp_fiber.yaml │ ├── greeter_service.cc │ ├── greeter_service.h │ ├── greeter_service_test.cc │ ├── helloworld.proto │ ├── helloworld_server.cc │ ├── run.sh │ ├── run_cmake.sh │ └── test │ │ ├── BUILD │ │ ├── conf │ │ ├── trpc_cpp_fiber.yaml │ │ └── trpc_cpp_future.yaml │ │ ├── fiber_client.cc │ │ └── future_client.cc └── unittest │ ├── BUILD │ ├── client │ ├── BUILD │ ├── greeter_client.cc │ ├── greeter_client.h │ ├── greeter_client_test.cc │ ├── helloworld_client.cc │ └── trpc_cpp.yaml │ ├── helloworld.proto │ └── server │ └── async │ ├── BUILD │ ├── greeter_service.cc │ ├── greeter_service.h │ ├── greeter_service_test.cc │ ├── helloworld_server.cc │ └── trpc_cpp.yaml ├── run_examples.sh ├── run_examples_cmake.sh ├── test ├── README.md └── end2end │ ├── BUILD │ ├── README.md │ ├── common │ ├── BUILD │ ├── subprocess.cc │ ├── subprocess.h │ ├── test_common.proto │ ├── test_common_service.cc │ ├── test_common_service.h │ ├── test_signaller.cc │ ├── test_signaller.h │ ├── util.cc │ └── util.h │ ├── gracefully_stop │ ├── README.md │ ├── forward │ │ ├── fiber │ │ │ ├── tcp │ │ │ │ ├── trpc_cpp_fiber_concurrency_1_conn_complex.yaml │ │ │ │ ├── trpc_cpp_fiber_concurrency_1_conn_pool.yaml │ │ │ │ ├── trpc_cpp_fiber_concurrency_4_conn_complex.yaml │ │ │ │ └── trpc_cpp_fiber_concurrency_4_conn_pool.yaml │ │ │ └── udp │ │ │ │ ├── trpc_cpp_fiber_concurrency_1_conn_complex.yaml │ │ │ │ ├── trpc_cpp_fiber_concurrency_1_conn_pool.yaml │ │ │ │ ├── trpc_cpp_fiber_concurrency_4_conn_complex.yaml │ │ │ │ └── trpc_cpp_fiber_concurrency_4_conn_pool.yaml │ │ ├── future │ │ │ ├── tcp │ │ │ │ ├── trpc_cpp_merge_iohandle_1_conn_complex.yaml │ │ │ │ ├── trpc_cpp_merge_iohandle_1_conn_pool.yaml │ │ │ │ ├── trpc_cpp_merge_iohandle_2_conn_complex.yaml │ │ │ │ ├── trpc_cpp_merge_iohandle_2_conn_pool.yaml │ │ │ │ ├── trpc_cpp_separate_io_1_handle_1_conn_complex.yaml │ │ │ │ ├── trpc_cpp_separate_io_1_handle_1_conn_pool.yaml │ │ │ │ ├── trpc_cpp_separate_io_2_handle_2_conn_complex.yaml │ │ │ │ └── trpc_cpp_separate_io_2_handle_2_conn_pool.yaml │ │ │ └── udp │ │ │ │ ├── trpc_cpp_merge_iohandle_1_conn_complex.yaml │ │ │ │ ├── trpc_cpp_merge_iohandle_1_conn_pool.yaml │ │ │ │ ├── trpc_cpp_merge_iohandle_2_conn_complex.yaml │ │ │ │ ├── trpc_cpp_merge_iohandle_2_conn_pool.yaml │ │ │ │ ├── trpc_cpp_separate_io_1_handle_1_conn_complex.yaml │ │ │ │ ├── trpc_cpp_separate_io_1_handle_1_conn_pool.yaml │ │ │ │ ├── trpc_cpp_separate_io_2_handle_2_conn_complex.yaml │ │ │ │ └── trpc_cpp_separate_io_2_handle_2_conn_pool.yaml │ │ ├── helloworld_svr_conf │ │ │ ├── trpc_cpp_tcp.yaml │ │ │ └── trpc_cpp_udp.yaml │ │ └── run_test.sh │ ├── helloworld │ │ ├── default │ │ │ ├── trpc_cpp_merge_iohandle_1.yaml │ │ │ ├── trpc_cpp_merge_iohandle_2.yaml │ │ │ ├── trpc_cpp_separate_io_1_handle_1.yaml │ │ │ └── trpc_cpp_separate_io_2_handle_2.yaml │ │ ├── fiber │ │ │ ├── trpc_cpp_fiber_concurrency_1.yaml │ │ │ └── trpc_cpp_fiber_concurrency_4.yaml │ │ └── run_test.sh │ └── run_test.sh │ ├── run_coverage.sh │ ├── stream │ ├── BUILD │ └── trpc │ │ ├── BUILD │ │ ├── async_stream_server.cc │ │ ├── async_stream_server.h │ │ ├── async_stream_test.cc │ │ ├── conf │ │ ├── BUILD │ │ ├── async_test │ │ │ ├── async_stream_client.yaml │ │ │ ├── async_stream_server.yaml │ │ │ └── sync_stream_server.yaml │ │ └── sync_test │ │ │ ├── async_stream_server.yaml │ │ │ ├── sync_stream_client.yaml │ │ │ └── sync_stream_server.yaml │ │ ├── stream.proto │ │ ├── stream_test.h │ │ ├── sync_stream_server.cc │ │ ├── sync_stream_server.h │ │ └── sync_stream_test.cc │ └── unary │ ├── BUILD │ ├── fiber │ ├── BUILD │ ├── README.md │ ├── conf │ │ └── fiber_test │ │ │ ├── BUILD │ │ │ ├── fiber_client.yaml │ │ │ └── fiber_server.yaml │ ├── fiber.proto │ ├── fiber_server.cc │ ├── fiber_server.h │ └── fiber_test.cc │ ├── future │ ├── BUILD │ ├── README.md │ ├── conf │ │ ├── BUILD │ │ ├── future_client_merge.yaml │ │ ├── future_client_separate.yaml │ │ ├── future_server_merge.yaml │ │ └── future_server_separate.yaml │ ├── future.proto │ ├── future_fixture.cc │ ├── future_fixture.h │ ├── future_server.cc │ ├── future_server.h │ └── future_test.cc │ ├── http │ ├── BUILD │ ├── README.md │ ├── conf │ │ ├── http_rpc_test │ │ │ ├── BUILD │ │ │ ├── http_client_fiber.yaml │ │ │ ├── http_client_merge.yaml │ │ │ ├── http_client_separate.yaml │ │ │ ├── http_server_fiber.yaml │ │ │ ├── http_server_merge.yaml │ │ │ └── http_server_separate.yaml │ │ ├── http_test │ │ │ ├── BUILD │ │ │ ├── http_client_fiber.yaml │ │ │ ├── http_client_merge.yaml │ │ │ ├── http_client_separate.yaml │ │ │ ├── http_server_fiber.yaml │ │ │ ├── http_server_merge.yaml │ │ │ └── http_server_separate.yaml │ │ └── https_test │ │ │ ├── BUILD │ │ │ ├── ca1 │ │ │ ├── server.csr │ │ │ ├── server.key │ │ │ └── server.pem │ │ │ ├── ca2 │ │ │ ├── server.csr │ │ │ ├── server.key │ │ │ └── server.pem │ │ │ ├── dhparam.pem │ │ │ ├── http_client_fiber.yaml │ │ │ ├── http_client_merge.yaml │ │ │ ├── http_client_separate.yaml │ │ │ ├── http_server_fiber.yaml │ │ │ ├── http_server_merge.yaml │ │ │ └── http_server_separate.yaml │ ├── http_rpc.proto │ ├── http_rpc_server.cc │ ├── http_rpc_server.h │ ├── http_rpc_test.cc │ ├── http_server.cc │ ├── http_server.h │ ├── http_test.cc │ ├── https_server.cc │ ├── https_server.h │ └── https_test.cc │ ├── redis │ ├── BUILD │ ├── README.md │ ├── conf │ │ ├── BUILD │ │ ├── redis_client_fiber.yaml │ │ ├── redis_client_merge.yaml │ │ ├── redis_client_separate.yaml │ │ └── redis_server.yaml │ ├── redis_client_test.cc │ ├── redis_server.cc │ └── redis_server.h │ ├── rpcz │ ├── BUILD │ ├── README.md │ ├── conf │ │ ├── BUILD │ │ ├── rpcz_client_fiber.yaml │ │ ├── rpcz_client_merge.yaml │ │ ├── rpcz_client_separate.yaml │ │ ├── rpcz_proxy_fiber.yaml │ │ ├── rpcz_proxy_merge.yaml │ │ ├── rpcz_proxy_separate.yaml │ │ ├── rpcz_real_server_fiber.yaml │ │ ├── rpcz_real_server_merge.yaml │ │ └── rpcz_real_server_separate.yaml │ ├── real_server.cc │ ├── real_server.h │ ├── real_server.proto │ ├── rpcz.proto │ ├── rpcz_fixture.cc │ ├── rpcz_fixture.h │ ├── rpcz_server.cc │ ├── rpcz_server.h │ └── rpcz_test.cc │ ├── trpc │ ├── BUILD │ ├── README.md │ ├── common_funcs.h │ ├── common_test.h │ ├── conf │ │ ├── BUILD │ │ ├── trpc_client_fiber.yaml │ │ ├── trpc_client_merge.yaml │ │ ├── trpc_client_separate.yaml │ │ ├── trpc_route_fiber.yaml │ │ ├── trpc_route_merge.yaml │ │ ├── trpc_route_separate.yaml │ │ ├── trpc_server_fiber.yaml │ │ ├── trpc_server_merge.yaml │ │ └── trpc_server_separate.yaml │ ├── trpc_route_server.cc │ ├── trpc_route_server.h │ ├── trpc_server.cc │ ├── trpc_server.h │ ├── trpc_server_transport_test_inc.h │ ├── trpc_test.cc │ ├── trpc_test.fbs │ └── trpc_test.proto │ └── tvar │ ├── BUILD │ ├── README.md │ ├── conf │ ├── BUILD │ ├── tvar_client_fiber.yaml │ ├── tvar_client_fiber_noseries.yaml │ ├── tvar_client_merge.yaml │ ├── tvar_client_merge_noseries.yaml │ ├── tvar_client_separate.yaml │ ├── tvar_client_separate_noseries.yaml │ ├── tvar_server_fiber.yaml │ ├── tvar_server_fiber_noseries.yaml │ ├── tvar_server_merge.yaml │ ├── tvar_server_merge_noseries.yaml │ ├── tvar_server_separate.yaml │ └── tvar_server_separate_noseries.yaml │ ├── tvar.proto │ ├── tvar_fixture.cc │ ├── tvar_fixture.h │ ├── tvar_server.cc │ ├── tvar_server.h │ ├── tvar_test.cc │ └── tvar_test_noseries.cc ├── third_party ├── BUILD ├── README.md ├── com_github_axboe_liburing │ ├── BUILD │ └── liburing.BUILD ├── com_github_fmtlib_fmt │ ├── BUILD │ └── fmtlib.BUILD ├── com_github_gabime_spdlog │ ├── 0001-flush-unit-change-for-milliseconds.patch │ ├── 0002-pre-allocate-file-buffer-size.patch │ ├── BUILD │ └── spdlog.BUILD ├── com_github_google_flatbuffers │ ├── 0001-feat-Modify-bazel-file.patch │ ├── BUILD │ └── flatbuffers.BUILD ├── com_github_google_snappy │ ├── BUILD │ └── snappy.BUILD ├── com_github_h2o_picohttpparser │ ├── BUILD │ └── picohttpparser.BUILD ├── com_github_lz4_lz4 │ ├── BUILD │ └── lz4.BUILD ├── com_github_madler_zlib │ ├── BUILD │ └── zlib.BUILD ├── com_github_nghttp2_nghttp2 │ ├── BUILD │ └── nghttp2.BUILD ├── com_github_openssl_openssl │ ├── BUILD │ └── openssl.BUILD ├── com_github_tencent_rapidjson │ ├── 0001-remove-non-compiling-assignment-operator.patch │ ├── BUILD │ └── rapidjson.BUILD ├── com_github_thalhammer_jwt_cpp │ ├── BUILD │ └── jwt_cpp.BUILD ├── com_github_toruniina_toml11 │ ├── BUILD │ └── toml.BUILD └── zlib │ ├── BUILD │ └── zlib.BUILD └── trpc ├── BUILD ├── admin ├── BUILD ├── README.md ├── admin_handler.cc ├── admin_handler.h ├── admin_handler_test.cc ├── admin_service.cc ├── admin_service.h ├── admin_service_test.cc ├── base_funcs.cc ├── base_funcs.h ├── base_funcs_test.cc ├── client_detach_handler.cc ├── client_detach_handler.h ├── client_detach_handler_test.cc ├── commands_handler.cc ├── commands_handler.h ├── commands_handler_test.cc ├── contention_profiler_handler.cc ├── contention_profiler_handler.h ├── contention_profiler_handler_test.cc ├── cpu_profiler_handler.cc ├── cpu_profiler_handler.h ├── cpu_profiler_handler_test.cc ├── heap_profiler_handler.cc ├── heap_profiler_handler.h ├── heap_profiler_handler_test.cc ├── index_handler.cc ├── index_handler.h ├── index_handler_test.cc ├── js │ ├── BUILD │ ├── flot_min_js.cc │ ├── flot_min_js.h │ ├── flot_min_js_test.cc │ ├── jquery_min_js.cc │ ├── jquery_min_js.h │ ├── jquery_min_js_test.cc │ ├── viz_min_js.cc │ ├── viz_min_js.h │ └── viz_min_js_test.cc ├── js_handler.cc ├── js_handler.h ├── js_handler_test.cc ├── log_level_handler.cc ├── log_level_handler.h ├── log_level_handler_test.cc ├── mutex.cc ├── mutex.h ├── mutex_test.cc ├── perl_tools │ ├── BUILD │ ├── pprof.cc │ ├── pprof.h │ └── pprof_test.cc ├── prometheus_handler.cc ├── prometheus_handler.h ├── prometheus_handler_test.cc ├── reload_config_handler.cc ├── reload_config_handler.h ├── reload_config_handler_test.cc ├── sample.cc ├── sample.h ├── sample_test.cc ├── stats_handler.cc ├── stats_handler.h ├── stats_handler_test.cc ├── sysvars_handler.cc ├── sysvars_handler.h ├── sysvars_handler_test.cc ├── test.yaml ├── test2.yaml ├── version_handler.cc ├── version_handler.h ├── version_handler_test.cc ├── watch_handler.cc ├── watch_handler.h ├── watch_handler_test.cc ├── web_css_jquery.cc ├── web_css_jquery.h └── web_css_jquery_test.cc ├── auth ├── BUILD ├── README.md ├── auth.h ├── auth_center_follower_factory.cc ├── auth_center_follower_factory.h ├── auth_center_follower_factory_test.cc ├── auth_factory.cc ├── auth_factory.h ├── auth_factory_test.cc └── testing │ ├── BUILD │ └── auth_testing.h ├── client ├── BUILD ├── README.md ├── client_context.cc ├── client_context.h ├── grpc │ ├── BUILD │ ├── grpc_fiber_test.cc │ └── testing │ │ ├── BUILD │ │ ├── grpc_client_call_testing.cc │ │ ├── grpc_client_call_testing.h │ │ └── grpc_fiber.yaml ├── http │ ├── BUILD │ ├── README.md │ ├── http_fiber_test.cc │ ├── http_service_proxy.cc │ ├── http_service_proxy.h │ ├── http_service_proxy_test.cc │ ├── http_stream_proxy.cc │ ├── http_stream_proxy.h │ ├── http_stream_proxy_test.cc │ └── testing │ │ ├── BUILD │ │ ├── http_client_call_testing.cc │ │ ├── http_client_call_testing.h │ │ ├── http_fiber.yaml │ │ └── http_fiber_with_ssl.yaml ├── make_client_context.cc ├── make_client_context.h ├── make_client_context_test.cc ├── non_rpc_service_proxy.h ├── non_rpc_service_proxy_test.cc ├── redis │ ├── BUILD │ ├── README.md │ ├── cmdgen.h │ ├── cmdgen_test.cc │ ├── formatter.cc │ ├── formatter.h │ ├── formatter_test.cc │ ├── reader.cc │ ├── reader.h │ ├── reader_test.cc │ ├── redis_service_proxy.cc │ ├── redis_service_proxy.h │ ├── redis_service_proxy_test.cc │ ├── reply.h │ ├── reply_test.cc │ └── request.h ├── rpc_service_proxy.cc ├── rpc_service_proxy.h ├── rpc_service_proxy_test.cc ├── service_proxy.cc ├── service_proxy.h ├── service_proxy_manager.cc ├── service_proxy_manager.h ├── service_proxy_option.h ├── service_proxy_option_setter.cc ├── service_proxy_option_setter.h ├── service_proxy_option_setter_test.cc ├── service_proxy_test.cc ├── testing │ ├── BUILD │ ├── client_context_testing.h │ ├── fiber_client.yaml │ ├── mock_client_transport.h │ └── service_proxy_testing.h ├── trpc_client.cc ├── trpc_client.h ├── trpc_client_test.cc └── trpc_service_proxy.h ├── codec ├── BUILD ├── README.md ├── client_codec.h ├── client_codec_factory.cc ├── client_codec_factory.h ├── client_codec_factory_test.cc ├── client_codec_test.cc ├── codec_helper.cc ├── codec_helper.h ├── codec_helper_test.cc ├── codec_manager.cc ├── codec_manager.h ├── codec_manager_test.cc ├── grpc │ ├── BUILD │ ├── grpc_client_codec.cc │ ├── grpc_client_codec.h │ ├── grpc_client_codec_test.cc │ ├── grpc_protocol.cc │ ├── grpc_protocol.h │ ├── grpc_protocol_test.cc │ ├── grpc_server_codec.cc │ ├── grpc_server_codec.h │ ├── grpc_server_codec_test.cc │ ├── grpc_stream_frame.h │ ├── grpc_stream_frame_test.cc │ └── http2 │ │ ├── BUILD │ │ ├── client_session.cc │ │ ├── client_session.h │ │ ├── http2.cc │ │ ├── http2.h │ │ ├── http2_test.cc │ │ ├── request.cc │ │ ├── request.h │ │ ├── request_test.cc │ │ ├── response.cc │ │ ├── response.h │ │ ├── response_test.cc │ │ ├── server_session.cc │ │ ├── server_session.h │ │ ├── session.cc │ │ ├── session.h │ │ ├── session_test.cc │ │ └── testing │ │ ├── BUILD │ │ └── mock_session.h ├── http │ ├── BUILD │ ├── README.md │ ├── http_client_codec.cc │ ├── http_client_codec.h │ ├── http_client_codec_test.cc │ ├── http_client_proto_checker_impl.cc │ ├── http_client_proto_checker_impl_test.cc │ ├── http_proto_checker.h │ ├── http_protocol.cc │ ├── http_protocol.h │ ├── http_protocol_test.cc │ ├── http_server_codec.cc │ ├── http_server_codec.h │ ├── http_server_codec_test.cc │ ├── http_server_proto_checker_impl.cc │ ├── http_server_proto_checker_impl_test.cc │ ├── http_stream_frame.h │ ├── http_stream_parser.cc │ ├── http_stream_parser.h │ └── http_stream_parser_test.cc ├── non_rpc_protocol.h ├── protocol.h ├── protocol_test.cc ├── redis │ ├── BUILD │ ├── redis_client_codec.cc │ ├── redis_client_codec.h │ ├── redis_client_codec_test.cc │ ├── redis_proto_checker.cc │ ├── redis_proto_checker.h │ ├── redis_proto_checker_test.cc │ ├── redis_protocol.cc │ ├── redis_protocol.h │ └── redis_protocol_test.cc ├── server_codec.h ├── server_codec_factory.cc ├── server_codec_factory.h ├── server_codec_factory_test.cc ├── server_codec_test.cc ├── testing │ ├── BUILD │ ├── client_codec_testing.h │ ├── protocol_testing.h │ └── server_codec_testing.h └── trpc │ ├── BUILD │ ├── README.md │ ├── testing │ ├── BUILD │ └── trpc_protocol_testing.h │ ├── trpc.proto │ ├── trpc_client_codec.cc │ ├── trpc_client_codec.h │ ├── trpc_proto_checker.cc │ ├── trpc_proto_checker.h │ ├── trpc_proto_checker_test.cc │ ├── trpc_protocol.cc │ ├── trpc_protocol.h │ ├── trpc_protocol_test.cc │ ├── trpc_server_codec.cc │ ├── trpc_server_codec.h │ └── trpc_server_codec_test.cc ├── common ├── BUILD ├── async_timer.h ├── config │ ├── BUILD │ ├── client_conf.cc │ ├── client_conf.h │ ├── client_conf_parser.h │ ├── client_conf_test.cc │ ├── config_helper.cc │ ├── config_helper.h │ ├── default_log_conf.cc │ ├── default_log_conf.h │ ├── default_log_conf_parser.cc │ ├── default_log_conf_parser.h │ ├── default_value.h │ ├── domain_naming_conf.cc │ ├── domain_naming_conf.h │ ├── domain_naming_conf_parser.h │ ├── domain_naming_conf_test.cc │ ├── global_conf.cc │ ├── global_conf.h │ ├── global_conf_parser.h │ ├── loadbalance_naming_conf.cc │ ├── loadbalance_naming_conf.h │ ├── loadbalance_naming_conf_parser.h │ ├── local_file_provider_conf.cc │ ├── local_file_provider_conf.h │ ├── local_file_provider_conf_parser.h │ ├── local_file_sink_conf.cc │ ├── local_file_sink_conf.h │ ├── local_file_sink_conf_parser.h │ ├── redis_client_conf.cc │ ├── redis_client_conf.h │ ├── redis_client_conf_parser.h │ ├── retry_conf.cc │ ├── retry_conf.h │ ├── retry_conf_parser.h │ ├── retry_conf_test.cc │ ├── server_conf.cc │ ├── server_conf.h │ ├── server_conf_parser.h │ ├── server_conf_test.cc │ ├── ssl_conf.cc │ ├── ssl_conf.h │ ├── ssl_conf_parser.h │ ├── ssl_conf_test.cc │ ├── stdout_sink_conf.cc │ ├── stdout_sink_conf.h │ ├── stdout_sink_conf_parser.h │ ├── testing │ │ └── fiber.yaml │ ├── trpc_config.cc │ ├── trpc_config.h │ ├── trpc_config_test.cc │ └── yaml_parser.h ├── coroutine │ ├── BUILD │ ├── task_executer.h │ ├── task_executor.h │ └── trpc │ │ ├── BUILD │ │ ├── trpc_coroutine_task.h │ │ ├── trpc_task_executer.h │ │ ├── trpc_task_executor.cc │ │ ├── trpc_task_executor.h │ │ └── trpc_task_executor_test.cc ├── future │ ├── BUILD │ ├── README.md │ ├── basics.h │ ├── exception.h │ ├── executor.h │ ├── function_traits.h │ ├── future.h │ ├── future_utility.h │ ├── reactor_executor.h │ └── types.h ├── logging │ ├── BUILD │ └── trpc_logging.h ├── plugin.h ├── plugin_test.cc ├── runtime_manager.cc ├── runtime_manager.h ├── runtime_manager_fiber_test.cc ├── runtime_manager_thread_test.cc ├── status.cc ├── status.h ├── status_test.cc ├── testing │ ├── BUILD │ ├── fiber_testing.yaml │ └── merge_testing.yaml ├── trpc_app.cc ├── trpc_app.h ├── trpc_plugin.cc ├── trpc_plugin.h ├── trpc_version.cc ├── trpc_version.h └── trpc_version_test.cc ├── compressor ├── BUILD ├── README.md ├── common │ ├── BUILD │ ├── util.cc │ ├── util.h │ ├── zlib_util.cc │ ├── zlib_util.h │ └── zlib_util_test.cc ├── compressor.cc ├── compressor.h ├── compressor_factory.cc ├── compressor_factory.h ├── compressor_factory_test.cc ├── compressor_type.h ├── gzip │ ├── BUILD │ ├── gzip_compressor.h │ └── gzip_compressor_test.cc ├── lz4 │ ├── BUILD │ ├── lz4_compressor.cc │ ├── lz4_compressor.h │ ├── lz4_compressor_test.cc │ ├── lz4_util.cc │ └── lz4_util.h ├── snappy │ ├── BUILD │ ├── snappy_compressor.cc │ ├── snappy_compressor.h │ └── snappy_compressor_test.cc ├── testing │ ├── BUILD │ └── compressor_testing.h ├── trpc_compressor.cc ├── trpc_compressor.h ├── trpc_compressor_test.cc └── zlib │ ├── BUILD │ ├── zlib_compressor.h │ └── zlib_compressor_test.cc ├── config ├── BUILD ├── README.md ├── codec.h ├── codec │ ├── BUILD │ ├── common │ │ ├── BUILD │ │ └── common_codec.h │ ├── json_codec.h │ ├── toml_codec.h │ └── yaml_codec.h ├── codec_factory.h ├── codec_factory_test.cc ├── config.h ├── config_factory.h ├── config_factory_test.cc ├── config_test.cc ├── default │ ├── BUILD │ ├── default_config.cc │ ├── default_config.h │ ├── default_config_test.cc │ ├── loader.cc │ ├── loader.h │ └── loader_test.cc ├── provider.h ├── provider │ └── local_file │ │ ├── BUILD │ │ ├── README.md │ │ ├── local_file_provider.h │ │ └── local_file_provider_test.cc ├── provider_factory.h ├── provider_factory_test.cc ├── testing │ ├── BUILD │ ├── codec_plugin_testing.h │ ├── config_plugin_testing.h │ ├── mock_config.h │ ├── provider_plugin_testing.h │ ├── test.yaml │ ├── test_load.json │ ├── test_load.toml │ └── test_load.yaml ├── trpc_conf.cc ├── trpc_conf.h ├── trpc_conf_compatible.cc ├── trpc_conf_compatible.h ├── trpc_conf_compatible_test.cc ├── trpc_conf_deprecated.h └── trpc_conf_test.cc ├── coroutine ├── BUILD ├── README.md ├── async.h ├── async_test.cc ├── fiber.cc ├── fiber.h ├── fiber │ ├── BUILD │ └── runtime.h ├── fiber_blocking_bounded_queue.h ├── fiber_blocking_bounded_queue_test.cc ├── fiber_blocking_noncontiguous_buffer.h ├── fiber_blocking_noncontiguous_buffer_test.cc ├── fiber_condition_variable.cc ├── fiber_condition_variable.h ├── fiber_condition_variable_test.cc ├── fiber_event.h ├── fiber_event_test.cc ├── fiber_execution_context.cc ├── fiber_execution_context.h ├── fiber_execution_context_test.cc ├── fiber_latch.cc ├── fiber_latch.h ├── fiber_latch_test.cc ├── fiber_local.h ├── fiber_local_test.cc ├── fiber_mutex.h ├── fiber_mutex_test.cc ├── fiber_seqlock.cc ├── fiber_seqlock.h ├── fiber_seqlock_test.cc ├── fiber_shared_mutex.cc ├── fiber_shared_mutex.h ├── fiber_shared_mutex_test.cc ├── fiber_test.cc ├── fiber_timed_mutex.cc ├── fiber_timed_mutex.h ├── fiber_timed_mutex_test.cc ├── fiber_timer.cc ├── fiber_timer.h ├── fiber_timer_test.cc ├── future.h ├── future_test.cc └── testing │ ├── BUILD │ ├── fiber_runtime.h │ ├── fiber_runtime_testing.cc │ └── mock_fiber.h ├── filter ├── BUILD ├── README.md ├── client_filter_base.h ├── client_filter_controller.cc ├── client_filter_controller.h ├── client_filter_controller_test.cc ├── client_filter_manager.cc ├── client_filter_manager.h ├── client_filter_manager_test.cc ├── filter.h ├── filter_base.h ├── filter_base_test.cc ├── filter_controller.cc ├── filter_controller.h ├── filter_controller_test.cc ├── filter_id_counter.cc ├── filter_id_counter.h ├── filter_id_counter_test.cc ├── filter_manager.cc ├── filter_manager.h ├── filter_point.h ├── filter_test.cc ├── retry │ ├── BUILD │ ├── retry_limit_client_filter.cc │ ├── retry_limit_client_filter.h │ └── retry_limit_client_filter_test.cc ├── rpc_filter.cc ├── rpc_filter.h ├── rpc_filter_test.cc ├── server_filter_base.h ├── server_filter_controller.cc ├── server_filter_controller.h ├── server_filter_controller_test.cc ├── server_filter_manager.cc ├── server_filter_manager.h ├── server_filter_manager_test.cc ├── testing │ ├── BUILD │ ├── client_filter_testing.h │ └── server_filter_testing.h ├── trpc_filter.cc └── trpc_filter.h ├── flatbuffers.bzl ├── future ├── BUILD ├── README.md ├── async_lock │ ├── BUILD │ ├── rwlock.h │ ├── rwlock_test.cc │ ├── semaphore.h │ ├── semaphore_test.cc │ ├── with_lock.h │ └── with_lock_test.cc ├── async_timer.cc ├── async_timer.h ├── async_timer_test.cc ├── basics.h ├── exception.h ├── exception_test.cc ├── executor.h ├── function_traits.h ├── future.h ├── future_test.cc ├── future_utility.h ├── future_utility_test.cc ├── reactor_executor.h ├── reactor_executor_test.cc └── types.h ├── log ├── BUILD ├── README.md ├── logging.h ├── printf_like.h ├── python_like.h ├── stream_like.h └── trpc_log.h ├── metrics ├── BUILD ├── README.md ├── metrics.h ├── metrics_factory.cc ├── metrics_factory.h ├── metrics_factory_test.cc ├── prometheus │ ├── BUILD │ ├── prometheus_client_filter.cc │ ├── prometheus_client_filter.h │ ├── prometheus_client_filter_test.cc │ ├── prometheus_common.cc │ ├── prometheus_common.h │ ├── prometheus_common_test.cc │ ├── prometheus_conf.cc │ ├── prometheus_conf.h │ ├── prometheus_conf_parser.h │ ├── prometheus_conf_test.cc │ ├── prometheus_metrics.cc │ ├── prometheus_metrics.h │ ├── prometheus_metrics_api.cc │ ├── prometheus_metrics_api.h │ ├── prometheus_metrics_api_test.cc │ ├── prometheus_metrics_test.cc │ ├── prometheus_server_filter.cc │ ├── prometheus_server_filter.h │ ├── prometheus_server_filter_test.cc │ └── testing │ │ └── prometheus_metrics.yaml ├── testing │ ├── BUILD │ ├── metrics.yaml │ └── metrics_testing.h ├── trpc_metrics.cc ├── trpc_metrics.h ├── trpc_metrics_deprecated.cc ├── trpc_metrics_deprecated.h ├── trpc_metrics_report.cc ├── trpc_metrics_report.h ├── trpc_metrics_report_test.cc └── trpc_metrics_test.cc ├── naming ├── BUILD ├── common │ ├── BUILD │ ├── common_defs.h │ ├── common_inc_deprecated.h │ ├── constants.h │ └── util │ │ ├── BUILD │ │ ├── hash │ │ ├── BUILD │ │ ├── city.cc │ │ ├── city.h │ │ ├── hash_func.cc │ │ ├── hash_func.h │ │ ├── md5.cc │ │ ├── md5.h │ │ ├── murmurhash3.cc │ │ └── murmurhash3.h │ │ ├── loadbalance │ │ ├── BUILD │ │ ├── hash │ │ │ ├── BUILD │ │ │ ├── common.cc │ │ │ ├── common.h │ │ │ ├── consistenthash_load_balance.cc │ │ │ ├── consistenthash_load_balance.h │ │ │ ├── modulohash_load_balance.cc │ │ │ └── modulohash_load_balance.h │ │ ├── polling │ │ │ ├── BUILD │ │ │ ├── polling_load_balance.cc │ │ │ └── polling_load_balance.h │ │ ├── trpc_load_balance.cc │ │ ├── trpc_load_balance.h │ │ └── weighted_round_robin │ │ │ ├── BUILD │ │ │ ├── weighted_round_robin_load_balancer.cc │ │ │ ├── weighted_round_robin_load_balancer.h │ │ │ └── weighted_round_robin_load_balancer_test.cc │ │ ├── utils_help.cc │ │ └── utils_help.h ├── direct │ ├── BUILD │ ├── README.md │ ├── direct_selector_filter.h │ ├── direct_selector_filter_test.cc │ ├── selector_direct.cc │ ├── selector_direct.h │ └── selector_direct_test.cc ├── domain │ ├── BUILD │ ├── README.md │ ├── domain_selector_filter.h │ ├── domain_selector_filter_test.cc │ ├── selector_domain.cc │ ├── selector_domain.h │ └── selector_domain_test.cc ├── limiter.h ├── limiter_factory.cc ├── limiter_factory.h ├── limiter_factory_test.cc ├── load_balance.h ├── load_balance_factory.cc ├── load_balance_factory.h ├── registry.h ├── registry_factory.cc ├── registry_factory.h ├── registry_factory_test.cc ├── selector.h ├── selector_factory.cc ├── selector_factory.h ├── selector_factory_test.cc ├── selector_workflow.cc ├── selector_workflow.h ├── selector_workflow_test.cc ├── testing │ ├── BUILD │ ├── domain_test.yaml │ ├── test.yaml │ ├── trpc_limiter_testing.h │ ├── trpc_registry_testing.h │ └── trpc_selector_testing.h ├── trpc_naming.cc ├── trpc_naming.h ├── trpc_naming_registry.cc └── trpc_naming_registry.h ├── overload_control ├── BUILD ├── README.md ├── common │ ├── BUILD │ ├── histogram.cc │ ├── histogram.h │ ├── histogram_test.cc │ ├── overload_control_factory.h │ ├── priority.h │ ├── priority_adapter.cc │ ├── priority_adapter.h │ ├── priority_adapter_test.cc │ ├── priority_conf_parse.h │ ├── report.cc │ ├── report.h │ ├── report_test.cc │ ├── report_test.yaml │ ├── request_priority.cc │ ├── request_priority.h │ ├── request_priority_test.cc │ ├── window.cc │ ├── window.h │ └── window_test.cc ├── concurrency_limiter │ ├── BUILD │ ├── concurrency_limiter_conf.cc │ ├── concurrency_limiter_conf.h │ ├── concurrency_limiter_conf_test.cc │ ├── concurrency_limiter_server_filter.cc │ ├── concurrency_limiter_server_filter.h │ ├── concurrency_limiter_server_filter_test.cc │ └── concurrency_overload_ctrl.yaml ├── fiber_limiter │ ├── BUILD │ ├── fiber_limiter_client_filter.cc │ ├── fiber_limiter_client_filter.h │ ├── fiber_limiter_client_filter_test.cc │ ├── fiber_limiter_conf.cc │ ├── fiber_limiter_conf.h │ ├── fiber_limiter_conf_test.cc │ ├── fiber_limiter_server_filter.cc │ ├── fiber_limiter_server_filter.h │ ├── fiber_limiter_server_filter_test.cc │ └── fibers_overload_ctrl.yaml ├── flow_control │ ├── BUILD │ ├── README.md │ ├── flow_controller.h │ ├── flow_controller_conf.cc │ ├── flow_controller_conf.h │ ├── flow_controller_conf_test.cc │ ├── flow_controller_factory.cc │ ├── flow_controller_factory.h │ ├── flow_controller_factory_test.cc │ ├── flow_controller_generator.cc │ ├── flow_controller_generator.h │ ├── flow_controller_generator_test.cc │ ├── flow_controller_server_filter.cc │ ├── flow_controller_server_filter.h │ ├── flow_controller_server_filter_test.cc │ ├── flow_test.yaml │ ├── hit_queue.cc │ ├── hit_queue.h │ ├── hit_queue_test.cc │ ├── seconds_limiter.cc │ ├── seconds_limiter.h │ ├── seconds_limiter_test.cc │ ├── smooth_limiter.cc │ ├── smooth_limiter.h │ ├── smooth_limiter_test.cc │ ├── tick_timer.cc │ ├── tick_timer.h │ └── tick_timer_test.cc ├── high_percentile │ ├── BUILD │ ├── high_avg.cc │ ├── high_avg.h │ ├── high_avg_ema.cc │ ├── high_avg_ema.h │ ├── high_avg_ema_test.cc │ ├── high_avg_strategy.cc │ ├── high_avg_strategy.h │ ├── high_avg_strategy_test.cc │ ├── high_avg_test.cc │ ├── high_percentile.yaml │ ├── high_percentile_conf.cc │ ├── high_percentile_conf.h │ ├── high_percentile_conf_test.cc │ ├── high_percentile_overload_controller.cc │ ├── high_percentile_overload_controller.h │ ├── high_percentile_overload_controller_test.cc │ ├── high_percentile_priority_impl.cc │ ├── high_percentile_priority_impl.h │ ├── high_percentile_priority_impl_test.cc │ ├── high_percentile_server_filter.cc │ ├── high_percentile_server_filter.h │ ├── high_percentile_server_filter_test.cc │ ├── max_in_every_n.cc │ ├── max_in_every_n.h │ └── max_in_every_n_test.cc ├── overload_control_defs.h ├── server_overload_controller.h ├── server_overload_controller_factory.h ├── server_overload_controller_factory_test.cc ├── testing │ ├── BUILD │ └── overload_control_testing.h ├── throttler │ ├── BUILD │ ├── throttler.cc │ ├── throttler.h │ ├── throttler.yaml │ ├── throttler_client_filter.cc │ ├── throttler_client_filter.h │ ├── throttler_client_filter_test.cc │ ├── throttler_conf.cc │ ├── throttler_conf.h │ ├── throttler_conf_test.cc │ ├── throttler_ema.cc │ ├── throttler_ema.h │ ├── throttler_ema_test.cc │ ├── throttler_overload_controller.cc │ ├── throttler_overload_controller.h │ ├── throttler_overload_controller_test.cc │ ├── throttler_priority_impl.cc │ ├── throttler_priority_impl.h │ ├── throttler_priority_impl_test.cc │ └── throttler_test.cc ├── token_bucket_limiter │ ├── BUILD │ ├── token_bucket_limiter_conf.cc │ ├── token_bucket_limiter_conf.h │ ├── token_bucket_limiter_conf_test.cc │ ├── token_bucket_limiter_server_filter.cc │ ├── token_bucket_limiter_server_filter.h │ ├── token_bucket_limiter_server_filter_test.cc │ ├── token_bucket_overload_controller.cc │ ├── token_bucket_overload_controller.h │ ├── token_bucket_overload_controller_test.cc │ └── token_bucket_overload_ctrl.yaml ├── trpc_overload_control.cc ├── trpc_overload_control.h └── window_limiter_control │ ├── BUILD │ ├── filter_test.yaml │ ├── window_limiter_overload_controller.cc │ ├── window_limiter_overload_controller.h │ ├── window_limiter_overload_controller_filter.cc │ ├── window_limiter_overload_controller_filter.h │ ├── window_limiter_overload_controller_filter_test.cc │ └── window_limiter_overload_controller_test.cc ├── proto ├── BUILD ├── testing │ ├── BUILD │ ├── helloworld.fbs │ └── helloworld.proto └── trpc.proto ├── rpcz ├── BUILD ├── README.md ├── collector.cc ├── collector.h ├── collector_test.cc ├── filter │ ├── BUILD │ ├── client_filter.cc │ ├── client_filter.h │ ├── client_filter_test.cc │ ├── rpcz_filter_index.h │ ├── server_filter.cc │ ├── server_filter.h │ └── server_filter_test.cc ├── rpcz.cc ├── rpcz.h ├── rpcz_test.cc ├── span.cc ├── span.h ├── span_test.cc ├── testing │ ├── BUILD │ └── rpcz.yaml ├── trpc_rpcz.cc ├── trpc_rpcz.h ├── trpc_rpcz_test.cc └── util │ ├── BUILD │ ├── block_group.h │ ├── block_group_test.cc │ ├── combiner.h │ ├── combiner_test.cc │ ├── link_list.h │ ├── link_list_test.cc │ ├── reducer.h │ ├── reducer_test.cc │ ├── rpcz_fixture.h │ ├── sampler.cc │ ├── sampler.h │ └── sampler_test.cc ├── runtime ├── BUILD ├── common │ ├── BUILD │ ├── heartbeat │ │ ├── BUILD │ │ ├── heartbeat_info.cc │ │ ├── heartbeat_info.h │ │ ├── heartbeat_report.cc │ │ ├── heartbeat_report.h │ │ └── heartbeat_report_test.cc │ ├── periphery_task_scheduler.cc │ ├── periphery_task_scheduler.h │ ├── periphery_task_scheduler_test.cc │ ├── runtime_info_report │ │ ├── BUILD │ │ ├── runtime_info_reporter.cc │ │ ├── runtime_info_reporter.h │ │ ├── runtime_info_reporter_test.cc │ │ └── test.yaml │ └── stats │ │ ├── BUILD │ │ ├── backup_request_stats.cc │ │ ├── backup_request_stats.h │ │ ├── backup_request_stats_test.cc │ │ ├── frame_stats.cc │ │ ├── frame_stats.h │ │ ├── frame_stats_test.cc │ │ ├── frame_stats_testing.h │ │ ├── server_stats.cc │ │ ├── server_stats.h │ │ ├── server_stats.yaml │ │ └── server_stats_test.cc ├── fiber_runtime.cc ├── fiber_runtime.h ├── init_runtime.h ├── iomodel │ ├── BUILD │ ├── README.md │ ├── async_io │ │ ├── BUILD │ │ ├── async_io.cc │ │ ├── async_io.h │ │ └── async_io_test.cc │ └── reactor │ │ ├── BUILD │ │ ├── common │ │ ├── BUILD │ │ ├── accept_connection_info.h │ │ ├── connection.h │ │ ├── connection_handler.h │ │ ├── default_io_handler.h │ │ ├── epoll.cc │ │ ├── epoll.h │ │ ├── epoll_poller.cc │ │ ├── epoll_poller.h │ │ ├── eventfd_notifier.cc │ │ ├── eventfd_notifier.h │ │ ├── io_handler.h │ │ ├── io_message.h │ │ ├── network_address.cc │ │ ├── network_address.h │ │ ├── network_address_test.cc │ │ ├── notifier.h │ │ ├── socket.cc │ │ ├── socket.h │ │ ├── socket_test.cc │ │ ├── unix_address.cc │ │ ├── unix_address.h │ │ └── unix_address_test.cc │ │ ├── default │ │ ├── BUILD │ │ ├── acceptor.h │ │ ├── reactor_impl.cc │ │ ├── reactor_impl.h │ │ ├── reactor_impl_test.cc │ │ ├── tcp_acceptor.cc │ │ ├── tcp_acceptor.h │ │ ├── tcp_acceptor_test.cc │ │ ├── tcp_connection.cc │ │ ├── tcp_connection.h │ │ ├── tcp_connection_test.cc │ │ ├── timer_queue.cc │ │ ├── timer_queue.h │ │ ├── timer_queue_test.cc │ │ ├── udp_transceiver.cc │ │ ├── udp_transceiver.h │ │ ├── udp_transceiver_test.cc │ │ ├── uds_acceptor.cc │ │ ├── uds_acceptor.h │ │ └── uds_acceptor_test.cc │ │ ├── event_handler.cc │ │ ├── event_handler.h │ │ ├── fiber │ │ ├── BUILD │ │ ├── fiber_acceptor.cc │ │ ├── fiber_acceptor.h │ │ ├── fiber_connection.cc │ │ ├── fiber_connection.h │ │ ├── fiber_connection_test.cc │ │ ├── fiber_reactor.cc │ │ ├── fiber_reactor.h │ │ ├── fiber_reactor_test.cc │ │ ├── fiber_tcp_connection.cc │ │ ├── fiber_tcp_connection.h │ │ ├── fiber_tcp_connection_test.cc │ │ ├── fiber_udp_transceiver.cc │ │ ├── fiber_udp_transceiver.h │ │ ├── fiber_udp_transceiver_test.cc │ │ ├── writing_buffer_list.cc │ │ ├── writing_buffer_list.h │ │ ├── writing_buffer_list_test.cc │ │ ├── writing_datagram_list.cc │ │ ├── writing_datagram_list.h │ │ └── writing_datagram_list_test.cc │ │ ├── poller.h │ │ ├── reactor.h │ │ └── testing │ │ ├── BUILD │ │ └── mock_connection_testing.h ├── merge_runtime.cc ├── merge_runtime.h ├── runtime.cc ├── runtime.h ├── runtime_compatible.cc ├── runtime_compatible.h ├── runtime_state.h ├── separate_runtime.cc ├── separate_runtime.h ├── testing │ ├── BUILD │ └── heartbeat_report_test.yaml └── threadmodel │ ├── BUILD │ ├── common │ ├── BUILD │ ├── msg_task.h │ ├── task_type.h │ ├── timer_task.h │ ├── worker_thread.cc │ └── worker_thread.h │ ├── fiber │ ├── BUILD │ ├── README.md │ ├── detail │ │ ├── BUILD │ │ ├── assembly.h │ │ ├── fcontext │ │ │ ├── aarch64 │ │ │ │ ├── jump_context.S │ │ │ │ └── make_context.S │ │ │ ├── ppc64le │ │ │ │ ├── jump_context.S │ │ │ │ └── make_context.S │ │ │ └── x86_64 │ │ │ │ ├── jump_context.S │ │ │ │ └── make_context.S │ │ ├── fiber_desc.cc │ │ ├── fiber_desc.h │ │ ├── fiber_desc_test.cc │ │ ├── fiber_entity.cc │ │ ├── fiber_entity.h │ │ ├── fiber_entity_test.cc │ │ ├── fiber_id_gen.h │ │ ├── fiber_worker.cc │ │ ├── fiber_worker.h │ │ ├── fiber_worker_test.cc │ │ ├── runnable_entity.h │ │ ├── scheduling │ │ │ ├── scheduling.cc │ │ │ ├── scheduling.h │ │ │ ├── scheduling_var.h │ │ │ ├── v1 │ │ │ │ ├── run_queue.cc │ │ │ │ ├── run_queue.h │ │ │ │ ├── run_queue_test.cc │ │ │ │ ├── scheduling_impl.cc │ │ │ │ └── scheduling_impl.h │ │ │ └── v2 │ │ │ │ ├── local_queue.cc │ │ │ │ ├── local_queue.h │ │ │ │ ├── scheduling_impl.cc │ │ │ │ └── scheduling_impl.h │ │ ├── scheduling_group.cc │ │ ├── scheduling_group.h │ │ ├── scheduling_group_test.cc │ │ ├── stack_allocator_impl.cc │ │ ├── stack_allocator_impl.h │ │ ├── stack_allocator_impl_test.cc │ │ ├── testing.h │ │ ├── timer_worker.cc │ │ ├── timer_worker.h │ │ ├── timer_worker_test.cc │ │ ├── waitable.cc │ │ ├── waitable.h │ │ └── waitable_test.cc │ ├── fiber_thread_model.cc │ └── fiber_thread_model.h │ ├── merge │ ├── BUILD │ ├── merge_thread_model.cc │ ├── merge_thread_model.h │ ├── merge_thread_model_test.cc │ ├── merge_worker_thread.cc │ └── merge_worker_thread.h │ ├── separate │ ├── BUILD │ ├── handle_worker_thread.cc │ ├── handle_worker_thread.h │ ├── io_worker_thread.cc │ ├── io_worker_thread.h │ ├── non_steal │ │ ├── BUILD │ │ ├── non_steal_scheduling.cc │ │ └── non_steal_scheduling.h │ ├── separate_scheduling.cc │ ├── separate_scheduling.h │ ├── separate_thread_model.cc │ ├── separate_thread_model.h │ ├── separate_thread_model_test.cc │ └── steal │ │ ├── BUILD │ │ ├── steal_scheduling.cc │ │ └── steal_scheduling.h │ ├── testing │ ├── BUILD │ ├── fiber.yaml │ ├── merge.yaml │ ├── separate.yaml │ └── thread_model_testing.h │ ├── thread_model.h │ ├── thread_model_manager.cc │ └── thread_model_manager.h ├── serialization ├── BUILD ├── README.md ├── flatbuffers │ ├── BUILD │ ├── fbs_serialization.cc │ ├── fbs_serialization.h │ └── fbs_serialization_test.cc ├── json │ ├── BUILD │ ├── json_serialization.cc │ ├── json_serialization.h │ └── json_serialization_test.cc ├── noop │ ├── BUILD │ ├── noop_serialization.cc │ ├── noop_serialization.h │ └── noop_serialization_test.cc ├── pb │ ├── BUILD │ ├── pb_serialization.cc │ ├── pb_serialization.h │ └── pb_serialization_test.cc ├── serialization.h ├── serialization_factory.cc ├── serialization_factory.h ├── serialization_factory_test.cc ├── serialization_type.h ├── testing │ ├── BUILD │ └── test_serialization.proto ├── trpc_serialization.cc └── trpc_serialization.h ├── server ├── BUILD ├── README.md ├── async_rpc │ ├── BUILD │ ├── async_rpc_method_handler.h │ ├── async_rpc_service_impl.cc │ ├── async_rpc_service_impl.h │ ├── async_rpc_service_impl_test.cc │ └── async_stream_rpc_method_handler.h ├── forward │ ├── BUILD │ ├── forward_rpc_method_handler.h │ ├── forward_rpc_service_impl.cc │ ├── forward_rpc_service_impl.h │ └── forward_rpc_service_impl_test.cc ├── http │ ├── BUILD │ ├── http_async_stream_service.cc │ ├── http_async_stream_service.h │ └── http_async_stream_service_test.cc ├── http_service.cc ├── http_service.h ├── make_server_context.h ├── method.h ├── method_handler.cc ├── method_handler.h ├── non_rpc │ ├── BUILD │ ├── non_rpc_method_handler.h │ ├── non_rpc_service_impl.cc │ ├── non_rpc_service_impl.h │ ├── non_rpc_service_impl_test.cc │ ├── non_rpc_service_method.h │ └── simple_non_rpc_service_impl.h ├── non_rpc_method_handler.h ├── non_rpc_service_impl.h ├── non_rpc_service_method.h ├── rpc │ ├── BUILD │ ├── rpc_method_handler.h │ ├── rpc_service_impl.cc │ ├── rpc_service_impl.h │ ├── rpc_service_impl_test.cc │ ├── rpc_service_method.h │ ├── stream_rpc_method_handler.h │ └── unary_rpc_method_handler.h ├── rpc_async_method_handler.h ├── rpc_method_handler.h ├── rpc_service_impl.h ├── rpc_service_method.h ├── server_context.cc ├── server_context.h ├── service.cc ├── service.h ├── service_adapter.cc ├── service_adapter.h ├── service_adapter_option.h ├── service_impl.cc ├── service_impl.h ├── stream_rpc_async_method_handler.h ├── stream_rpc_method_handler.h ├── testing │ ├── BUILD │ ├── fiber_server_testing.h │ ├── greeter_service_testing.cc │ ├── greeter_service_testing.h │ ├── http_client_testing.cc │ ├── http_client_testing.h │ ├── http_service_testing.cc │ ├── http_service_testing.h │ ├── merge_server.yaml │ ├── mock_server_transport.h │ ├── server_context_testing.h │ ├── server_fiber.yaml │ ├── server_fiber_with_ssl.yaml │ ├── service_adapter_testing.h │ ├── stream_transport_testing.cc │ ├── stream_transport_testing.h │ ├── trpc_client_testing.cc │ └── trpc_client_testing.h ├── trpc_server.cc ├── trpc_server.h ├── trpc_server_test.cc └── trpc_server_with_stream_rpc_test.cc ├── stream ├── BUILD ├── README.md ├── client_stream_handler_factory.h ├── common_stream.cc ├── common_stream.h ├── common_stream_test.cc ├── fiber_stream_job_scheduler.cc ├── fiber_stream_job_scheduler.h ├── fiber_stream_job_scheduler_test.cc ├── grpc │ ├── BUILD │ ├── grpc_client_stream_connection_handler.cc │ ├── grpc_client_stream_connection_handler.h │ ├── grpc_client_stream_connection_handler_test.cc │ ├── grpc_client_stream_handler.cc │ ├── grpc_client_stream_handler.h │ ├── grpc_client_stream_handler_test.cc │ ├── grpc_io_handler.cc │ ├── grpc_io_handler.h │ ├── grpc_io_handler_test.cc │ ├── grpc_server_stream.cc │ ├── grpc_server_stream.h │ ├── grpc_server_stream_connection_handler.cc │ ├── grpc_server_stream_connection_handler.h │ ├── grpc_server_stream_connection_handler_test.cc │ ├── grpc_server_stream_handler.cc │ ├── grpc_server_stream_handler.h │ ├── grpc_server_stream_handler_test.cc │ ├── grpc_server_stream_test.cc │ ├── grpc_stream.cc │ ├── grpc_stream.h │ ├── grpc_stream_test.cc │ ├── util.cc │ ├── util.h │ └── util_test.cc ├── http │ ├── BUILD │ ├── async │ │ ├── BUILD │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── stream.cc │ │ │ ├── stream.h │ │ │ ├── stream_connection_handler.cc │ │ │ ├── stream_connection_handler.h │ │ │ ├── stream_connection_handler_test.cc │ │ │ ├── stream_handler.cc │ │ │ ├── stream_handler.h │ │ │ ├── stream_handler_test.cc │ │ │ └── stream_test.cc │ │ ├── server │ │ │ ├── BUILD │ │ │ ├── stream.cc │ │ │ ├── stream.h │ │ │ ├── stream_connection_handler.cc │ │ │ ├── stream_connection_handler.h │ │ │ ├── stream_connection_handler_test.cc │ │ │ ├── stream_handler.cc │ │ │ ├── stream_handler.h │ │ │ ├── stream_handler_test.cc │ │ │ ├── stream_test.cc │ │ │ └── testing │ │ │ │ ├── BUILD │ │ │ │ └── mock_server_async_stream.h │ │ ├── stream.cc │ │ ├── stream.h │ │ ├── stream_function_handler.h │ │ ├── stream_reader_writer.cc │ │ ├── stream_reader_writer.h │ │ ├── stream_reader_writer_test.cc │ │ ├── stream_test.cc │ │ └── testing │ │ │ ├── BUILD │ │ │ └── mock_async_stream.h │ ├── common.cc │ ├── common.h │ ├── common │ │ ├── BUILD │ │ ├── client │ │ │ ├── BUILD │ │ │ ├── stream_handler.cc │ │ │ ├── stream_handler.h │ │ │ └── stream_handler_test.cc │ │ ├── server │ │ │ ├── BUILD │ │ │ ├── stream_handler.cc │ │ │ ├── stream_handler.h │ │ │ └── stream_handler_test.cc │ │ ├── stream.cc │ │ ├── stream.h │ │ ├── stream_handler.cc │ │ ├── stream_handler.h │ │ ├── stream_handler_test.cc │ │ ├── stream_test.cc │ │ └── testing │ │ │ ├── BUILD │ │ │ └── mock_stream.h │ ├── common_test.cc │ ├── http_client_stream.cc │ ├── http_client_stream.h │ ├── http_client_stream_connection_handler.cc │ ├── http_client_stream_connection_handler.h │ ├── http_client_stream_connection_handler_test.cc │ ├── http_client_stream_handler.cc │ ├── http_client_stream_handler.h │ ├── http_client_stream_handler_test.cc │ ├── http_client_stream_test.cc │ ├── http_stream.cc │ ├── http_stream.h │ ├── http_stream_provider.h │ └── http_stream_test.cc ├── server_stream_handler_factory.h ├── stream.h ├── stream_async.h ├── stream_async_test.cc ├── stream_handler.h ├── stream_handler_manager.cc ├── stream_handler_manager.h ├── stream_handler_manager_test.cc ├── stream_message.h ├── stream_provider.h ├── stream_provider_test.cc ├── stream_test.cc ├── stream_var.cc ├── stream_var.h ├── stream_var_test.cc ├── testing │ ├── BUILD │ ├── mock_connection.h │ ├── mock_stream_handler.h │ ├── mock_stream_provider.h │ └── stream.proto ├── trpc │ ├── BUILD │ ├── testing │ │ ├── BUILD │ │ └── trpc_stream_testing.h │ ├── trpc_client_stream.cc │ ├── trpc_client_stream.h │ ├── trpc_client_stream_connection_handler.cc │ ├── trpc_client_stream_connection_handler.h │ ├── trpc_client_stream_connection_handler_test.cc │ ├── trpc_client_stream_handler.cc │ ├── trpc_client_stream_handler.h │ ├── trpc_client_stream_handler_test.cc │ ├── trpc_client_stream_test.cc │ ├── trpc_server_stream.cc │ ├── trpc_server_stream.h │ ├── trpc_server_stream_connection_handler.cc │ ├── trpc_server_stream_connection_handler.h │ ├── trpc_server_stream_connection_handler_test.cc │ ├── trpc_server_stream_handler.cc │ ├── trpc_server_stream_handler.h │ ├── trpc_server_stream_handler_test.cc │ ├── trpc_server_stream_test.cc │ ├── trpc_stream.cc │ ├── trpc_stream.h │ ├── trpc_stream_flow_controller.h │ ├── trpc_stream_flow_controller_test.cc │ ├── trpc_stream_handler.cc │ ├── trpc_stream_handler.h │ ├── trpc_stream_handler_test.cc │ └── trpc_stream_test.cc ├── util.cc └── util.h ├── telemetry ├── BUILD ├── telemetry.h ├── telemetry_factory.cc ├── telemetry_factory.h ├── telemetry_factory_test.cc ├── trpc_telemetry.cc ├── trpc_telemetry.h └── trpc_telemetry_test.cc ├── tools ├── README.md ├── comm │ ├── BUILD │ ├── trpc_cpp_options.proto │ ├── utils.cc │ └── utils.h ├── flatbuffers_tool │ ├── BUILD │ ├── CMakeLists.txt │ ├── fbs2cpp.cc │ ├── fbs2cpp.h │ ├── fbs2cpp_test.cc │ ├── fbs_gen_test_fixture.h │ ├── idl_gen_trpc.cc │ ├── idl_gen_trpc.h │ ├── idl_gen_trpc_test.cc │ ├── main.cc │ ├── parse_fbs_file.cc │ ├── parse_fbs_file.h │ ├── parse_fbs_file_test.cc │ ├── schema_interface.h │ └── testing │ │ ├── BUILD │ │ ├── greeter.fbs │ │ ├── greeter.trpc.fb_cc.txt │ │ ├── greeter.trpc.fb_h.txt │ │ └── greeter_generated_h.txt ├── gdb_plugin │ ├── README.md │ └── gdb_fiber_plugin.py └── trpc_cpp_plugin │ ├── BUILD │ ├── CMakeLists.txt │ ├── README.md │ ├── gen_hdr.cc │ ├── gen_mock.cc │ ├── gen_src.cc │ ├── main.cc │ └── template │ ├── trpc.cc.tpl │ ├── trpc.h.tpl │ └── trpc.mock.h.tpl ├── tracing ├── BUILD ├── README.md ├── tracing.h ├── tracing_factory.cc ├── tracing_factory.h ├── tracing_factory_test.cc ├── tracing_filter_index.h ├── trpc_tracing.cc ├── trpc_tracing.h └── trpc_tracing_test.cc ├── transport ├── README.md ├── client │ ├── BUILD │ ├── client_transport.h │ ├── client_transport_message.h │ ├── common │ │ ├── BUILD │ │ ├── client_io_handler.cc │ │ ├── client_io_handler.h │ │ ├── client_io_handler_factory.cc │ │ ├── client_io_handler_factory.h │ │ ├── client_transport_state.h │ │ ├── redis_client_io_handler.cc │ │ └── redis_client_io_handler.h │ ├── fiber │ │ ├── BUILD │ │ ├── common │ │ │ ├── BUILD │ │ │ ├── call_context.h │ │ │ ├── fiber_backup_request_retry.cc │ │ │ ├── fiber_backup_request_retry.h │ │ │ ├── fiber_client_connection_handler.cc │ │ │ ├── fiber_client_connection_handler.h │ │ │ ├── fiber_client_connection_handler_factory.cc │ │ │ ├── fiber_client_connection_handler_factory.h │ │ │ └── sharded_call_map.h │ │ ├── conn_complex │ │ │ ├── BUILD │ │ │ ├── fiber_tcp_conn_complex_connector.cc │ │ │ ├── fiber_tcp_conn_complex_connector.h │ │ │ ├── fiber_tcp_conn_complex_connector_group.cc │ │ │ ├── fiber_tcp_conn_complex_connector_group.h │ │ │ ├── fiber_udp_io_complex_connector.cc │ │ │ ├── fiber_udp_io_complex_connector.h │ │ │ ├── fiber_udp_io_complex_connector_group.cc │ │ │ └── fiber_udp_io_complex_connector_group.h │ │ ├── conn_pool │ │ │ ├── BUILD │ │ │ ├── fiber_tcp_conn_pool_connector.cc │ │ │ ├── fiber_tcp_conn_pool_connector.h │ │ │ ├── fiber_tcp_conn_pool_connector_group.cc │ │ │ ├── fiber_tcp_conn_pool_connector_group.h │ │ │ ├── fiber_udp_io_pool_connector.cc │ │ │ ├── fiber_udp_io_pool_connector.h │ │ │ ├── fiber_udp_io_pool_connector_group.cc │ │ │ └── fiber_udp_io_pool_connector_group.h │ │ ├── fiber_connector_group.h │ │ ├── fiber_connector_group_manager.cc │ │ ├── fiber_connector_group_manager.h │ │ ├── fiber_transport.cc │ │ ├── fiber_transport.h │ │ ├── fiber_transport_test.cc │ │ ├── pipeline │ │ │ ├── BUILD │ │ │ ├── fiber_tcp_pipeline_connector.cc │ │ │ ├── fiber_tcp_pipeline_connector.h │ │ │ ├── fiber_tcp_pipeline_connector_group.cc │ │ │ └── fiber_tcp_pipeline_connector_group.h │ │ └── testing │ │ │ ├── BUILD │ │ │ ├── fake_server.h │ │ │ ├── fiber_transport_test.yaml │ │ │ └── thread_model_op.h │ ├── fixed_connector_id.h │ ├── future │ │ ├── BUILD │ │ ├── README.md │ │ ├── common │ │ │ ├── BUILD │ │ │ ├── future_connection_handler.cc │ │ │ ├── future_connection_handler.h │ │ │ ├── future_connector.h │ │ │ ├── future_connector_options.h │ │ │ ├── future_transport_adapter.cc │ │ │ ├── future_transport_adapter.h │ │ │ ├── timingwheel.h │ │ │ ├── timingwheel_timeout_queue.h │ │ │ ├── timingwheel_timeout_queue_test.cc │ │ │ ├── utils.cc │ │ │ └── utils.h │ │ ├── conn_complex │ │ │ ├── BUILD │ │ │ ├── future_conn_complex_connection_handler.cc │ │ │ ├── future_conn_complex_connection_handler.h │ │ │ ├── future_conn_complex_connection_handler_factory.cc │ │ │ ├── future_conn_complex_connection_handler_factory.h │ │ │ ├── future_conn_complex_message_timeout_handler.cc │ │ │ ├── future_conn_complex_message_timeout_handler.h │ │ │ ├── future_tcp_conn_complex_connector.cc │ │ │ ├── future_tcp_conn_complex_connector.h │ │ │ ├── future_tcp_conn_complex_connector_group.cc │ │ │ ├── future_tcp_conn_complex_connector_group.h │ │ │ ├── future_udp_io_complex_connector.cc │ │ │ ├── future_udp_io_complex_connector.h │ │ │ ├── future_udp_io_complex_connector_group.cc │ │ │ └── future_udp_io_complex_connector_group.h │ │ ├── conn_pool │ │ │ ├── BUILD │ │ │ ├── conn_pool.h │ │ │ ├── conn_pool_test.cc │ │ │ ├── future_conn_pool_connection_handler.cc │ │ │ ├── future_conn_pool_connection_handler.h │ │ │ ├── future_conn_pool_connection_handler_factory.cc │ │ │ ├── future_conn_pool_connection_handler_factory.h │ │ │ ├── future_conn_pool_message_timeout_handler.cc │ │ │ ├── future_conn_pool_message_timeout_handler.h │ │ │ ├── future_tcp_conn_pool_connector.cc │ │ │ ├── future_tcp_conn_pool_connector.h │ │ │ ├── future_tcp_conn_pool_connector_group.cc │ │ │ ├── future_tcp_conn_pool_connector_group.h │ │ │ ├── future_udp_io_pool_connector.cc │ │ │ ├── future_udp_io_pool_connector.h │ │ │ ├── future_udp_io_pool_connector_group.cc │ │ │ ├── future_udp_io_pool_connector_group.h │ │ │ ├── shared_send_queue.cc │ │ │ ├── shared_send_queue.h │ │ │ └── shared_send_queue_test.cc │ │ ├── future_connector_group.h │ │ ├── future_connector_group_manager.h │ │ ├── future_tcp_connector_group_manager.cc │ │ ├── future_tcp_connector_group_manager.h │ │ ├── future_transport.cc │ │ ├── future_transport.h │ │ ├── future_transport_test.cc │ │ ├── future_udp_connector_group_manager.cc │ │ ├── future_udp_connector_group_manager.h │ │ ├── pipeline │ │ │ ├── BUILD │ │ │ ├── future_pipeline_message_timeout_handler.cc │ │ │ ├── future_pipeline_message_timeout_handler.h │ │ │ ├── future_tcp_pipeline_connector.cc │ │ │ ├── future_tcp_pipeline_connector.h │ │ │ ├── future_tcp_pipeline_connector_group.cc │ │ │ ├── future_tcp_pipeline_connector_group.h │ │ │ ├── pipeline_conn_pool.h │ │ │ └── pipeline_conn_pool_test.cc │ │ └── testing │ │ │ ├── BUILD │ │ │ ├── fake_trpc_server.h │ │ │ └── merge_separate_threadmodel.yaml │ ├── preallocation_option.h │ ├── retry_info_def.h │ └── trans_info.h ├── common │ ├── BUILD │ ├── connection_handler_manager.cc │ ├── connection_handler_manager.h │ ├── connection_handler_manager_test.cc │ ├── io_handler_manager.cc │ ├── io_handler_manager.h │ ├── io_handler_manager_test.cc │ ├── ssl │ │ ├── BUILD │ │ ├── cert │ │ │ ├── README.md │ │ │ ├── ca │ │ │ │ └── xxops-com-chain │ │ │ │ │ ├── mk_ca_root_key.sh │ │ │ │ │ ├── mk_xxops_com_csr_cert.sh │ │ │ │ │ ├── mk_xxops_com_dhparam.sh │ │ │ │ │ ├── root-ca.crt │ │ │ │ │ ├── root-ca.key │ │ │ │ │ ├── root-ca.srl │ │ │ │ │ ├── xxops-com.crt │ │ │ │ │ ├── xxops-com.csr │ │ │ │ │ ├── xxops-com.dhparam │ │ │ │ │ └── xxops-com.key │ │ │ ├── client_ca_cert.pem │ │ │ ├── server_cert.pem │ │ │ ├── server_dhparam.pem │ │ │ ├── server_key.pem │ │ │ ├── xxops-com-chain.pem │ │ │ ├── xxops-com.crt │ │ │ ├── xxops-com.dhparam │ │ │ └── xxops-com.key │ │ ├── core.h │ │ ├── errno.h │ │ ├── random.h │ │ ├── random_test.cc │ │ ├── ssl.cc │ │ ├── ssl.h │ │ └── ssl_test.cc │ ├── ssl_helper.cc │ ├── ssl_helper.h │ ├── ssl_helper_test.cc │ ├── ssl_io_handler.cc │ ├── ssl_io_handler.h │ ├── ssl_io_handler_test.cc │ ├── transport_message.h │ └── transport_message_common.h └── server │ ├── BUILD │ ├── common │ ├── BUILD │ ├── server_connection_handler.h │ ├── server_io_handler_factory.cc │ ├── server_io_handler_factory.h │ └── server_io_handler_factory_test.cc │ ├── default │ ├── BUILD │ ├── bind_adapter.cc │ ├── bind_adapter.h │ ├── connection_manager.cc │ ├── connection_manager.h │ ├── connection_manager_test.cc │ ├── server_connection_handler.cc │ ├── server_connection_handler.h │ ├── server_connection_handler_factory.cc │ ├── server_connection_handler_factory.h │ ├── server_transport_impl.cc │ ├── server_transport_impl.h │ └── server_transport_impl_test.cc │ ├── fiber │ ├── BUILD │ ├── fiber_bind_adapter.cc │ ├── fiber_bind_adapter.h │ ├── fiber_connection_manager.cc │ ├── fiber_connection_manager.h │ ├── fiber_server_connection_handler.cc │ ├── fiber_server_connection_handler.h │ ├── fiber_server_connection_handler_factory.cc │ ├── fiber_server_connection_handler_factory.h │ ├── fiber_server_transport_impl.cc │ ├── fiber_server_transport_impl.h │ └── fiber_server_transport_impl_test.cc │ ├── server_transport.h │ ├── server_transport_def.h │ ├── server_transport_message.h │ └── testing │ ├── BUILD │ └── server_transport_testing.h ├── trpc.bzl ├── tvar ├── BUILD ├── README.md ├── basic_ops │ ├── BUILD │ ├── basic_traits.h │ ├── noseries_test.cc │ ├── passive_status.h │ ├── passive_status_test.cc │ ├── recorder.h │ ├── recorder_test.cc │ ├── reducer.h │ ├── reducer_test.cc │ ├── status.h │ └── status_test.cc ├── common │ ├── BUILD │ ├── atomic_type.h │ ├── atomic_type_test.cc │ ├── fast_rand.cc │ ├── fast_rand.h │ ├── macros.h │ ├── op_util.h │ ├── op_util_test.cc │ ├── percentile.cc │ ├── percentile.h │ ├── percentile_test.cc │ ├── sampler.cc │ ├── sampler.h │ ├── sampler_test.cc │ ├── series.h │ ├── series_test.cc │ ├── tvar_group.cc │ ├── tvar_group.h │ ├── tvar_group_test.cc │ └── write_mostly.h ├── compound_ops │ ├── BUILD │ ├── internal_latency.h │ ├── internal_latency_test.cc │ ├── latency_recorder.cc │ ├── latency_recorder.h │ ├── latency_recorder_test.cc │ ├── noseries_test.cc │ ├── window.h │ └── window_test.cc ├── testing │ ├── BUILD │ ├── noseries.yaml │ └── series.yaml └── tvar.h ├── util ├── BUILD ├── README.md ├── algorithm │ ├── BUILD │ ├── hash.cc │ ├── hash.h │ ├── hash_test.cc │ ├── power_of_two.cc │ ├── power_of_two.h │ ├── power_of_two_test.cc │ └── random.h ├── align.h ├── async_io │ ├── BUILD │ └── async_io.h ├── bind_core_manager.cc ├── bind_core_manager.h ├── bind_core_manager_test.cc ├── buffer │ ├── BUILD │ ├── buffer.cc │ ├── buffer.h │ ├── buffer_test.cc │ ├── contiguous_buffer.cc │ ├── contiguous_buffer.h │ ├── contiguous_buffer_test.cc │ ├── memory_pool │ │ ├── BUILD │ │ ├── common.cc │ │ ├── common.h │ │ ├── common_test.cc │ │ ├── disabled_memory_pool.cc │ │ ├── disabled_memory_pool.h │ │ ├── disabled_memory_pool_test.cc │ │ ├── global_memory_pool.cc │ │ ├── global_memory_pool.h │ │ ├── global_memory_pool_test.cc │ │ ├── memory_pool.cc │ │ ├── memory_pool.h │ │ ├── memory_pool_test.cc │ │ ├── shared_nothing_memory_pool.cc │ │ ├── shared_nothing_memory_pool.h │ │ └── shared_nothing_memory_pool_test.cc │ ├── noncontiguous_buffer.cc │ ├── noncontiguous_buffer.h │ ├── noncontiguous_buffer_test.cc │ ├── noncontiguous_buffer_view.cc │ ├── noncontiguous_buffer_view.h │ ├── noncontiguous_buffer_view_test.cc │ ├── testing │ │ ├── BUILD │ │ └── message.proto │ ├── zero_copy_stream.cc │ ├── zero_copy_stream.h │ └── zero_copy_stream_test.cc ├── check.cc ├── check.h ├── check_test.cc ├── chrono │ ├── BUILD │ ├── chrono.cc │ ├── chrono.h │ ├── chrono_test.cc │ ├── time.cc │ ├── time.h │ ├── time_test.cc │ ├── tsc.cc │ └── tsc.h ├── concurrency │ ├── BUILD │ ├── detail │ │ ├── BUILD │ │ ├── lightly_concurrent_hashmap_impl.h │ │ └── lightly_concurrent_hashmap_impl_test.cc │ └── lightly_concurrent_hashmap.h ├── container │ ├── BUILD │ ├── bounded_queue.h │ ├── bounded_queue_test.cc │ ├── container.h │ └── fixed_arena_allocator.h ├── deferred.h ├── delayed_init.h ├── delayed_init_test.cc ├── domain_util.cc ├── domain_util.h ├── domain_util_test.cc ├── doubly_linked_list.h ├── erased_ptr.h ├── erased_ptr_test.cc ├── flatbuffers │ ├── BUILD │ ├── message_fbs.h │ ├── trpc_fbs.cc │ ├── trpc_fbs.h │ └── trpc_fbs_test.cc ├── function.h ├── function_test.cc ├── function_view.h ├── function_view_test.cc ├── hash_util.h ├── hazptr │ ├── BUILD │ ├── README.md │ ├── entry.h │ ├── entry_cache.cc │ ├── entry_cache.h │ ├── hazptr.h │ ├── hazptr_domain.cc │ ├── hazptr_domain.h │ ├── hazptr_object.cc │ └── hazptr_object.h ├── http │ ├── BUILD │ ├── base64.h │ ├── base64_test.cc │ ├── body_params.h │ ├── common.h │ ├── content.cc │ ├── content.h │ ├── exception.h │ ├── exception_test.cc │ ├── field_map.h │ ├── field_map_test.cc │ ├── function_handlers.h │ ├── handler.h │ ├── header.h │ ├── header_test.cc │ ├── http_cookie.cc │ ├── http_cookie.h │ ├── http_cookie_test.cc │ ├── http_handler.h │ ├── http_handler_groups.h │ ├── http_handler_groups_test.cc │ ├── http_handler_test.cc │ ├── http_header.h │ ├── http_parser.cc │ ├── http_parser.h │ ├── http_parser_test.cc │ ├── match_rule.h │ ├── match_rule_test.cc │ ├── matcher.cc │ ├── matcher.h │ ├── matcher_test.cc │ ├── method.cc │ ├── method.h │ ├── method_test.cc │ ├── mime_types.cc │ ├── mime_types.h │ ├── mime_types_test.cc │ ├── parameter.h │ ├── parameter_test.cc │ ├── path.h │ ├── path_test.cc │ ├── reply.h │ ├── request.cc │ ├── request.h │ ├── request_test.cc │ ├── response.cc │ ├── response.h │ ├── response_test.cc │ ├── routes.cc │ ├── routes.h │ ├── routes_test.cc │ ├── status.cc │ ├── status.h │ ├── status_test.cc │ ├── stream │ │ ├── BUILD │ │ ├── http_client_stream_response.h │ │ ├── http_start_line.h │ │ ├── http_stream_handler.h │ │ ├── stream_function_handlers.h │ │ ├── stream_function_handlers_test.cc │ │ └── stream_handler.h │ ├── url.cc │ ├── url.h │ ├── url_test.cc │ ├── util.cc │ ├── util.h │ └── util_test.cc ├── internal │ ├── BUILD │ ├── README.md │ ├── casting.h │ ├── casting_test.cc │ ├── demangle.cc │ ├── demangle.h │ ├── demangle_test.cc │ ├── doubly_linked_list.h │ ├── doubly_linked_list_test.cc │ ├── index_alloc.cc │ ├── index_alloc.h │ ├── index_alloc_test.cc │ ├── meta.h │ ├── never_destroyed.h │ ├── never_destroyed_test.cc │ ├── singly_linked_list.h │ ├── singly_linked_list_test.cc │ ├── time_keeper.cc │ ├── time_keeper.h │ └── time_keeper_test.cc ├── latch.h ├── likely.h ├── lockfree_queue.h ├── log │ ├── BUILD │ ├── README.md │ ├── default │ │ ├── BUILD │ │ ├── default_log.cc │ │ ├── default_log.h │ │ ├── default_log_test.cc │ │ ├── sinks │ │ │ ├── local_file │ │ │ │ ├── BUILD │ │ │ │ ├── file_helper.cc │ │ │ │ ├── file_helper.h │ │ │ │ ├── file_helper_test.cc │ │ │ │ ├── hourly_file_sink.h │ │ │ │ ├── hourly_file_sink_test.cc │ │ │ │ ├── local_file_sink.cc │ │ │ │ ├── local_file_sink.h │ │ │ │ └── local_file_sink_test.cc │ │ │ └── stdout │ │ │ │ ├── BUILD │ │ │ │ ├── stdout_sink.h │ │ │ │ └── stdout_sink_test.cc │ │ └── testing │ │ │ ├── BUILD │ │ │ ├── default_log_test.yaml │ │ │ └── mock_sink.h │ ├── log.h │ ├── log_test.cc │ ├── logging.cc │ ├── logging.h │ ├── logging_test.cc │ ├── printf_like.h │ ├── printf_like_test.cc │ ├── python_like.h │ ├── python_like_test.cc │ ├── stream_like.h │ ├── stream_like_test.cc │ └── testing │ │ ├── BUILD │ │ ├── mock_log.h │ │ └── trpc_log_test.yaml ├── net_util.cc ├── net_util.h ├── net_util_test.cc ├── object_pool │ ├── BUILD │ ├── README.md │ ├── disabled.h │ ├── disabled_test.cc │ ├── global.h │ ├── global_test.cc │ ├── object_pool.h │ ├── object_pool_ptr.h │ ├── object_pool_ptr_test.cc │ ├── shared_nothing.cc │ ├── shared_nothing.h │ ├── shared_nothing_test.cc │ └── util.h ├── pb2json.cc ├── pb2json.h ├── pb2json_test.cc ├── prometheus.cc ├── prometheus.h ├── prometheus_test.cc ├── queue │ ├── BUILD │ ├── bounded_mpmc_queue.h │ ├── bounded_mpmc_queue_test.cc │ ├── bounded_mpsc_queue.h │ ├── bounded_mpsc_queue_test.cc │ ├── bounded_spmc_queue.h │ ├── bounded_spmc_queue_test.cc │ ├── detail │ │ ├── BUILD │ │ └── util.h │ ├── lockfree_queue.h │ ├── lockfree_queue_test.cc │ └── unbounded_spmc_queue.h ├── random.h ├── ref_ptr.h ├── ref_ptr_test.cc ├── singleton.h ├── singleton_test.cc ├── string │ ├── BUILD │ ├── string_helper.cc │ ├── string_helper.h │ ├── string_helper_test.cc │ ├── string_util.cc │ ├── string_util.h │ └── string_util_test.cc ├── string_helper.h ├── string_util.h ├── testing │ ├── BUILD │ └── testjson.proto ├── thread │ ├── BUILD │ ├── bounded_mpmc_queue.h │ ├── bounded_mpsc_queue.h │ ├── compile.h │ ├── cpu.cc │ ├── cpu.h │ ├── cpu_test.cc │ ├── futex_notifier.h │ ├── futex_notifier_test.cc │ ├── internal │ │ ├── BUILD │ │ ├── memory_barrier.cc │ │ ├── memory_barrier.h │ │ └── object_array.h │ ├── latch.cc │ ├── latch.h │ ├── latch_test.cc │ ├── memory_barrier.h │ ├── mq_thread_pool.cc │ ├── mq_thread_pool.h │ ├── mq_thread_pool_task.h │ ├── mq_thread_pool_test.cc │ ├── mq_thread_pool_worker.h │ ├── predicate_notifier.h │ ├── process_info.cc │ ├── process_info.h │ ├── process_info_test.cc │ ├── spinlock.cc │ ├── spinlock.h │ ├── spinlock_test.cc │ ├── sq_thread_pool.cc │ ├── sq_thread_pool.h │ ├── sq_thread_pool_test.cc │ ├── thread_cond.h │ ├── thread_helper.cc │ ├── thread_helper.h │ ├── thread_helper_test.cc │ ├── thread_local.h │ ├── thread_local_test.cc │ ├── thread_lock.h │ ├── thread_monitor.h │ ├── thread_monitor_test.cc │ ├── thread_mutex.h │ ├── thread_pool.h │ ├── thread_pool_option.h │ ├── thread_pool_test.cc │ └── unbounded_spmc_queue.h ├── time.cc ├── time.h └── unique_id.h └── workspace.bzl /.bazelignore: -------------------------------------------------------------------------------- 1 | cmake_third_party 2 | -------------------------------------------------------------------------------- /.bazelrc: -------------------------------------------------------------------------------- 1 | build --cxxopt="--std=c++17" 2 | build --copt=-O2 3 | #build --copt=-g --strip=never 4 | build --jobs 16 5 | #test --cache_test_results=no --test_output=errors 6 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | BasedOnStyle: Google 3 | ColumnLimit: 120 4 | 5 | # Force pointers to the type for C++. 6 | # If `true`, analyze the formatted file for the most common alignment of '&' and '*'. 7 | DerivePointerAlignment: false 8 | PointerAlignment: Left 9 | 10 | # Only sort headers in each include block 11 | SortIncludes: true 12 | IncludeBlocks: Preserve -------------------------------------------------------------------------------- /.github/.codecov.yml: -------------------------------------------------------------------------------- 1 | comment: 2 | layout: "reach,diff,flags,tree" 3 | behavior: default 4 | require_changes: false 5 | 6 | coverage: 7 | status: 8 | project: 9 | default: 10 | informational: true 11 | threshold: 1% 12 | patch: false 13 | patch: false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .idea/ 3 | 4 | bazel-* 5 | *.swp 6 | *.o 7 | *.log 8 | *.so 9 | *.a 10 | *.dylib 11 | 12 | CMakeCache.txt 13 | CMakeFiles 14 | CMakeScripts 15 | cmake_third_party/ 16 | cmake-build-debug/ 17 | 18 | build/ 19 | *.pb.h 20 | *.pb.cc 21 | 22 | -------------------------------------------------------------------------------- /BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/BUILD -------------------------------------------------------------------------------- /WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "trpc_cpp") 2 | 3 | load("//trpc:workspace.bzl", "trpc_workspace") 4 | 5 | trpc_workspace() 6 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | bazel build //trpc/... 4 | -------------------------------------------------------------------------------- /clean.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | bazel clean --expunge 4 | 5 | # Delete xx.log or xx.bin on root directory of trpc-cpp project. 6 | find ./ -maxdepth 1 -name "*.log" -exec rm {} \; 7 | find ./ -maxdepth 1 -name "*.bin" -exec rm {} \; 8 | -------------------------------------------------------------------------------- /cmake/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/cmake/README.md -------------------------------------------------------------------------------- /cmake/tools/copy_fmt_to_spdlog.sh: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Tencent is pleased to support the open source community by making tRPC available. 4 | # 5 | # Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | # All rights reserved. 7 | # 8 | # If you have downloaded a copy of the tRPC source code from Tencent, 9 | # please note that tRPC source code is licensed under the Apache 2.0 License, 10 | # A copy of the Apache 2.0 License is included in this file. 11 | # 12 | # 13 | 14 | TRPC_ROOT_PATH=$1 15 | 16 | # override fmt lib in spdlog to avoid conflict 17 | if [ -d "${TRPC_ROOT_PATH}/cmake_third_party/fmt/include/fmt/" ]; then 18 | cp -rfp ${TRPC_ROOT_PATH}/cmake_third_party/fmt/include/fmt/* ${TRPC_ROOT_PATH}/cmake_third_party/spdlog/include/spdlog/fmt/bundled/ 19 | fi 20 | -------------------------------------------------------------------------------- /docker/dockerfile-gcc7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docker/dockerfile-gcc7 -------------------------------------------------------------------------------- /docker/dockerfile-gcc8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docker/dockerfile-gcc8 -------------------------------------------------------------------------------- /docs/images/admin_main_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/admin_main_page.png -------------------------------------------------------------------------------- /docs/images/arch_design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/arch_design.png -------------------------------------------------------------------------------- /docs/images/backup_request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/backup_request.png -------------------------------------------------------------------------------- /docs/images/client_guide_invoke_routine_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/client_guide_invoke_routine_en.png -------------------------------------------------------------------------------- /docs/images/client_guide_invoke_routine_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/client_guide_invoke_routine_zh.png -------------------------------------------------------------------------------- /docs/images/concurrency_limiter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/concurrency_limiter.png -------------------------------------------------------------------------------- /docs/images/config_design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/config_design.png -------------------------------------------------------------------------------- /docs/images/dir_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/dir_structure.png -------------------------------------------------------------------------------- /docs/images/faq/client_invoke_error_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/faq/client_invoke_error_code.png -------------------------------------------------------------------------------- /docs/images/faq/crash_when_double_free.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/faq/crash_when_double_free.png -------------------------------------------------------------------------------- /docs/images/faq/crash_when_port_conflict.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/faq/crash_when_port_conflict.png -------------------------------------------------------------------------------- /docs/images/faq/crash_when_then_capture_raw_pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/faq/crash_when_then_capture_raw_pointer.png -------------------------------------------------------------------------------- /docs/images/faq/crash_when_throw_exectpion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/faq/crash_when_throw_exectpion.png -------------------------------------------------------------------------------- /docs/images/faq/http_problem_wrong_usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/faq/http_problem_wrong_usage.png -------------------------------------------------------------------------------- /docs/images/fiber_limiter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/fiber_limiter.png -------------------------------------------------------------------------------- /docs/images/fiber_threadmodel_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/fiber_threadmodel_arch.png -------------------------------------------------------------------------------- /docs/images/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/filter.png -------------------------------------------------------------------------------- /docs/images/filter_point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/filter_point.png -------------------------------------------------------------------------------- /docs/images/flow_control_limiter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/flow_control_limiter.png -------------------------------------------------------------------------------- /docs/images/flow_control_limiter_second_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/flow_control_limiter_second_1.png -------------------------------------------------------------------------------- /docs/images/flow_control_limiter_second_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/flow_control_limiter_second_2.png -------------------------------------------------------------------------------- /docs/images/flow_control_limiter_smooth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/flow_control_limiter_smooth.png -------------------------------------------------------------------------------- /docs/images/future_promise_state_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/future_promise_state_en.png -------------------------------------------------------------------------------- /docs/images/future_promise_state_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/future_promise_state_zh.png -------------------------------------------------------------------------------- /docs/images/future_promise_structure_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/future_promise_structure_en.png -------------------------------------------------------------------------------- /docs/images/future_promise_structure_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/future_promise_structure_zh.png -------------------------------------------------------------------------------- /docs/images/high_percenttile_limiter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/high_percenttile_limiter.png -------------------------------------------------------------------------------- /docs/images/interaction_process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/interaction_process.png -------------------------------------------------------------------------------- /docs/images/log_design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/log_design.png -------------------------------------------------------------------------------- /docs/images/m_n_coroutine_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/m_n_coroutine_en.png -------------------------------------------------------------------------------- /docs/images/m_n_coroutine_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/m_n_coroutine_zh.png -------------------------------------------------------------------------------- /docs/images/merge_threadmodel_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/merge_threadmodel_arch.png -------------------------------------------------------------------------------- /docs/images/plugin_factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/plugin_factory.png -------------------------------------------------------------------------------- /docs/images/quick_start_helloworld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/quick_start_helloworld.png -------------------------------------------------------------------------------- /docs/images/rpcz_client_filter_point_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_client_filter_point_en.png -------------------------------------------------------------------------------- /docs/images/rpcz_client_filter_point_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_client_filter_point_zh.png -------------------------------------------------------------------------------- /docs/images/rpcz_design_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_design_en.png -------------------------------------------------------------------------------- /docs/images/rpcz_design_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_design_zh.png -------------------------------------------------------------------------------- /docs/images/rpcz_perfetto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_perfetto.png -------------------------------------------------------------------------------- /docs/images/rpcz_sample_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_sample_en.png -------------------------------------------------------------------------------- /docs/images/rpcz_sample_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_sample_zh.png -------------------------------------------------------------------------------- /docs/images/rpcz_server_filter_point_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_server_filter_point_en.png -------------------------------------------------------------------------------- /docs/images/rpcz_server_filter_point_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/rpcz_server_filter_point_zh.png -------------------------------------------------------------------------------- /docs/images/separate_threadmodel_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/separate_threadmodel_arch.png -------------------------------------------------------------------------------- /docs/images/timeout_control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/timeout_control.png -------------------------------------------------------------------------------- /docs/images/tracing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/tracing.png -------------------------------------------------------------------------------- /docs/images/transparent_service_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/transparent_service_en.png -------------------------------------------------------------------------------- /docs/images/transparent_service_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/transparent_service_zh.png -------------------------------------------------------------------------------- /docs/images/trpc_protocol_client-async.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/trpc_protocol_client-async.png -------------------------------------------------------------------------------- /docs/images/trpc_protocol_client-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/trpc_protocol_client-client.png -------------------------------------------------------------------------------- /docs/images/trpc_protocol_client-forword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/trpc_protocol_client-forword.png -------------------------------------------------------------------------------- /docs/images/trpc_protocol_client-rpc_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/trpc_protocol_client-rpc_interface.png -------------------------------------------------------------------------------- /docs/images/trpc_protocol_service_stub_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/trpc_protocol_service_stub_en.png -------------------------------------------------------------------------------- /docs/images/trpc_protocol_service_stub_zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/images/trpc_protocol_service_stub_zh.png -------------------------------------------------------------------------------- /docs/zh/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/docs/zh/README.md -------------------------------------------------------------------------------- /docs/zh/faq.md: -------------------------------------------------------------------------------- 1 | # tRPC-Cpp常见问题 2 | 3 | 对日常遇到的问题做了知识沉淀,按各场景整理了一些常见问题以及排查问题的指南,按需取用。 4 | 5 | ## 问题排查指南 6 | 7 | - [性能问题排查排查指南](faq/low_performance.md) 8 | - [客户端超时/失败/长尾问题排查指南](faq/unexpected_cost_time.md) 9 | - [程序crash问题排查指南](faq/program_crash.md) 10 | 11 | ## 常见问题汇总 12 | 13 | - [bazel和cmake常见编译问题](faq/bazel_and_cmake_problem.md) 14 | - [protobuf/proto文件管理常见问题](faq/protobuf_and_proto_import_problem.md) 15 | - [fiber常见问题](faq/fiber_problem.md) 16 | - [future/promise常见问题](faq/future_promise_problem.md) 17 | - [http常见问题](faq/http_promblem.md) 18 | - [日志常见问题](faq/log_problem.md) 19 | -------------------------------------------------------------------------------- /examples/features/admin/client/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "client", 7 | srcs = ["client.cc"], 8 | deps = [ 9 | "//examples/features/admin/proxy:forward_proto", 10 | "@com_github_gflags_gflags//:gflags", 11 | "@trpc_cpp//trpc/client:make_client_context", 12 | "@trpc_cpp//trpc/client:trpc_client", 13 | "@trpc_cpp//trpc/common:runtime_manager", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /examples/features/admin/client/trpc_cpp.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 8 | 9 | plugins: 10 | log: 11 | default: 12 | - name: default 13 | sinks: 14 | local_file: 15 | filename: client.log 16 | -------------------------------------------------------------------------------- /examples/features/admin/proxy/forward.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.route; 4 | 5 | import "examples/helloworld/helloworld.proto"; 6 | 7 | service Forward { 8 | rpc Route (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 9 | } -------------------------------------------------------------------------------- /examples/features/fiber_forward/client/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "client", 3 | srcs = ["client.cc"], 4 | deps = [ 5 | "//examples/features/fiber_forward/proxy:forward_proto", 6 | "@com_github_gflags_gflags//:gflags", 7 | "@trpc_cpp//trpc/client:make_client_context", 8 | "@trpc_cpp//trpc/client:trpc_client", 9 | "@trpc_cpp//trpc/common:runtime_manager", 10 | "@trpc_cpp//trpc/common:trpc_plugin", 11 | "@trpc_cpp//trpc/coroutine:fiber", 12 | "@trpc_cpp//trpc/util:latch", 13 | "@trpc_cpp//trpc/util:time", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /examples/features/fiber_forward/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/fiber_forward/proxy/forward.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.route; 4 | 5 | import "examples/helloworld/helloworld.proto"; 6 | 7 | service Forward { 8 | rpc Route (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 9 | 10 | rpc ParallelRoute (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 11 | } -------------------------------------------------------------------------------- /examples/features/filter/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/examples/features/filter/BUILD -------------------------------------------------------------------------------- /examples/features/filter/client/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "demo_client", 5 | srcs = ["demo_client.cc"], 6 | deps = [ 7 | "//examples/features/filter/common:invoke_stat_filter", 8 | "//examples/features/filter/common:user_rpc_filter", 9 | "//examples/helloworld:helloworld_proto", 10 | "@com_github_gflags_gflags//:gflags", 11 | "@trpc_cpp//trpc/client:make_client_context", 12 | "@trpc_cpp//trpc/client:trpc_client", 13 | "@trpc_cpp//trpc/common:runtime_manager", 14 | "@trpc_cpp//trpc/common:trpc_plugin", 15 | "@trpc_cpp//trpc/future:future_utility", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /examples/features/filter/client/trpc_cpp_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: separate 6 | io_thread_num: 2 7 | handle_thread_num: 6 8 | 9 | client: 10 | service: 11 | - name: trpc.test.helloworld.Greeter 12 | target: 127.0.0.1:10001 13 | protocol: trpc 14 | timeout: 1000 15 | network: tcp 16 | selector_name: direct 17 | filter: # service-level filter 18 | - user_pb_rpc_client_filter 19 | filter: # global filter 20 | - client_invoke_stat 21 | -------------------------------------------------------------------------------- /examples/features/filter/common/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "user_rpc_filter", 5 | hdrs = [ 6 | "user_rpc_filter.h", 7 | ], 8 | deps = [ 9 | "//examples/helloworld:helloworld_proto", 10 | "@trpc_cpp//trpc/filter:rpc_filter", 11 | ], 12 | ) 13 | 14 | cc_library( 15 | name = "invoke_stat_filter", 16 | hdrs = [ 17 | "invoke_stat_filter.h", 18 | ], 19 | deps = [ 20 | "@trpc_cpp//trpc/filter:filter", 21 | "@trpc_cpp//trpc/common/logging:trpc_logging", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /examples/features/filter/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # build 4 | bazel build //examples/features/filter/server:demo_server 5 | bazel build //examples/features/filter/client:demo_client 6 | 7 | # start server and client 8 | ./bazel-bin/examples/features/filter/server/demo_server --config=./examples/features/filter/server/trpc_cpp_fiber.yaml & 9 | sleep 1 10 | ./bazel-bin/examples/features/filter/client/demo_client --client_config=./examples/features/filter/client/trpc_cpp_separate.yaml 11 | 12 | killall demo_server -------------------------------------------------------------------------------- /examples/features/filter/run_cmake.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 3 | mkdir -p examples/features/filter/build && cd examples/features/filter/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 4 | 5 | # start server and client 6 | ./examples/features/filter/build/demo_server --config=./examples/features/filter/server/trpc_cpp_fiber.yaml & 7 | sleep 1 8 | ./examples/features/filter/build/demo_client --client_config=./examples/features/filter/client/trpc_cpp_separate.yaml 9 | 10 | killall demo_server -------------------------------------------------------------------------------- /examples/features/filter/server/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "demo_server", 5 | srcs = ["demo_server.cc"], 6 | linkopts = [ 7 | "-ldl", 8 | ] + select({ 9 | "@trpc_cpp//trpc:trpc_enable_profiler": ["/usr/lib64/libtcmalloc_and_profiler.so"], 10 | "//conditions:default": [], 11 | }), 12 | deps = [ 13 | "//examples/helloworld:helloworld_proto", 14 | "//examples/features/filter/common:invoke_stat_filter", 15 | "//examples/features/filter/common:user_rpc_filter", 16 | "@trpc_cpp//trpc/common:status", 17 | "@trpc_cpp//trpc/common:trpc_app", 18 | "@trpc_cpp//trpc/common/logging:trpc_logging", 19 | ], 20 | ) 21 | -------------------------------------------------------------------------------- /examples/features/future_forward/client/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "client", 3 | srcs = ["client.cc"], 4 | deps = [ 5 | "//examples/features/future_forward/proxy:forward_proto", 6 | "@com_github_gflags_gflags//:gflags", 7 | "@trpc_cpp//trpc/client:make_client_context", 8 | "@trpc_cpp//trpc/common:runtime_manager", 9 | "@trpc_cpp//trpc/client:trpc_client", 10 | "@trpc_cpp//trpc/common:trpc_plugin", 11 | "@trpc_cpp//trpc/future:future_utility", 12 | "@trpc_cpp//trpc/util:time", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /examples/features/future_forward/client/trpc_cpp_future.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: separate 6 | io_thread_num: 1 7 | handle_thread_num: 1 -------------------------------------------------------------------------------- /examples/features/future_forward/proxy/forward.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.route; 4 | 5 | import "examples/helloworld/helloworld.proto"; 6 | 7 | service Forward { 8 | rpc Route (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 9 | 10 | rpc ParallelRoute (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 11 | } -------------------------------------------------------------------------------- /examples/features/grpc_stream/common/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "helper", 7 | srcs = ["helper.cc"], 8 | hdrs = ["helper.h"], 9 | deps = [ 10 | "//examples/features/grpc_stream/server:stream_proto", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /examples/features/grpc_stream/server/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | 6 | server: 7 | app: test 8 | server: helloworld 9 | service: 10 | - name: trpc.test.helloworld.RouteGuide 11 | network: tcp 12 | ip: 0.0.0.0 13 | port: 50051 14 | protocol: grpc 15 | 16 | plugins: 17 | log: 18 | default: 19 | - name: default 20 | min_level: 2 # 0-trace, 1-debug, 2-info, 3-warn, 4-error, 5-critical 21 | format: "[%Y-%m-%d %H:%M:%S.%e] [thread %t] [%l] [%@] %v" 22 | mode: 1 # 1-sync 2-async, 3-fast 23 | sinks: 24 | local_file: 25 | eol: true 26 | filename: grpc_stream_server.log -------------------------------------------------------------------------------- /examples/features/http/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/http/server/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "http_server", 7 | srcs = ["http_server.cc"], 8 | linkopts = ["-ldl"], 9 | deps = [ 10 | "@trpc_cpp//trpc/common:trpc_app", 11 | "@trpc_cpp//trpc/server:http_service", 12 | "@trpc_cpp//trpc/util/http:function_handlers", 13 | "@trpc_cpp//trpc/util/http:http_handler", 14 | "@trpc_cpp//trpc/util/http:routes", 15 | "@trpc_cpp//trpc/util/log:logging", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /examples/features/http/server/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | 6 | server: 7 | app: test 8 | server: test1 9 | service: 10 | - name: default_http_service 11 | network: tcp 12 | ip: 0.0.0.0 13 | port: 24856 14 | protocol: http 15 | 16 | plugins: 17 | log: 18 | default: 19 | - name: default 20 | min_level: 2 # 0-trace, 1-debug, 2-info, 3-warn, 4-error, 5-critical 21 | format: "[%Y-%m-%d %H:%M:%S.%e] [thread %t] [%l] [%@] %v" 22 | mode: 1 # 1-sync 2-async, 3-fast 23 | sinks: 24 | local_file: 25 | eol: true 26 | filename: http_server.log -------------------------------------------------------------------------------- /examples/features/http_async_upload_download/server/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "http_async_upload_download_server", 7 | srcs = ["http_server.cc"], 8 | linkopts = ["-ldl"], 9 | deps = [ 10 | "@trpc_cpp//trpc/common:trpc_app", 11 | "@trpc_cpp//trpc/future:future_utility", 12 | "@trpc_cpp//trpc/server:http_service", 13 | "@trpc_cpp//trpc/server/http:http_async_stream_service", 14 | "@trpc_cpp//trpc/util:random", 15 | "@trpc_cpp//trpc/util/log:logging", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /examples/features/http_rpc/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/http_rpc/server/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "http_rpc_server", 7 | srcs = ["http_server.cc"], 8 | linkopts = ["-ldl"], 9 | deps = [ 10 | "//examples/helloworld:greeter_service", 11 | "@trpc_cpp//trpc/common:trpc_app", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /examples/features/http_rpc/server/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | 6 | server: 7 | app: test 8 | server: test1 9 | service: 10 | - name: trpc.test.helloworld.Greeter 11 | network: tcp 12 | ip: 0.0.0.0 13 | port: 24857 14 | protocol: trpc_over_http 15 | 16 | plugins: 17 | log: 18 | default: 19 | - name: default 20 | min_level: 2 # 0-trace, 1-debug, 2-info, 3-warn, 4-error, 5-critical 21 | format: "[%Y-%m-%d %H:%M:%S.%e] [thread %t] [%l] [%@] %v" 22 | mode: 1 # 1-sync 2-async, 3-fast 23 | sinks: 24 | local_file: 25 | eol: true 26 | filename: http_rpc_server.log -------------------------------------------------------------------------------- /examples/features/http_upload_download/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/http_upload_download/server/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | 6 | server: 7 | app: test 8 | server: test1 9 | service: 10 | - name: http_upload_download_service 11 | network: tcp 12 | ip: 0.0.0.0 13 | port: 24858 14 | protocol: http 15 | 16 | plugins: 17 | log: 18 | default: 19 | - name: default 20 | min_level: 2 # 0-trace, 1-debug, 2-info, 3-warn, 4-error, 5-critical 21 | format: "[%Y-%m-%d %H:%M:%S.%e] [thread %t] [%l] [%@] %v" 22 | mode: 1 # 1-sync 2-async, 3-fast 23 | sinks: 24 | local_file: 25 | eol: true 26 | filename: http_upload_download_server.log 27 | -------------------------------------------------------------------------------- /examples/features/https/cert/README.md: -------------------------------------------------------------------------------- 1 | `cert` directory was used for unit testing only, it contains `Self-Sigined CA Key` and `Server Key`, 2 | they were used by unit test case. 3 | 4 | !!! Note: Don't used them in production environment. -------------------------------------------------------------------------------- /examples/features/https/cert/server_dhparam.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEAnMcSkTzUn1MrECQqZWO4/PsOlpmScZ0zGtKueDanUtSNZfVymkqi 3 | 5SdLefAocDpvbdP5caGpAGrVRxAk3M6Qw4fl05cCoJNAHBRDiDpRq6Py1HbNJ6D0 4 | QZUtZMt3ZaGGTKIo5uk5EoPaxxyJG/2TvEgkn25TEJyuP8qE82Ou5s/Gv7Z4kC9i 5 | yyKZXVbYc/YKkpz5u0pAnVwjYLMbHZ+W/hTI6zqv7UF3YM4Kpc9Z86HOZxxPwLqA 6 | /NBNlMj9GgwODKiiK+pYSY58JO6ApGmwVrry6Mi9tCKHWH/3iHdaypcA5SaGhDHL 7 | 5JSkeSQhsDh1aLaSZP4bwjCo8S+uyJyEmwIBAg== 8 | -----END DH PARAMETERS----- 9 | -------------------------------------------------------------------------------- /examples/features/https/server/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "https_server", 7 | srcs = ["https_server.cc"], 8 | linkopts = ["-ldl"], 9 | deps = [ 10 | "@trpc_cpp//trpc/common:trpc_app", 11 | "@trpc_cpp//trpc/server:http_service", 12 | "@trpc_cpp//trpc/util/http:http_handler", 13 | "@trpc_cpp//trpc/util/http:routes", 14 | "@trpc_cpp//trpc/util/log:logging", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /examples/features/prometheus/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 8 | 9 | client: 10 | filter: 11 | - prometheus 12 | 13 | plugins: 14 | metrics: 15 | prometheus: 16 | histogram_module_cfg: 17 | - 1 18 | - 5 19 | - 10 20 | const_labels: 21 | const_key1: const_value1 22 | const_key2: const_value2 23 | log: 24 | default: 25 | - name: default 26 | sinks: 27 | local_file: 28 | filename: client.log 29 | -------------------------------------------------------------------------------- /examples/features/prometheus/proxy/forward.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.route; 4 | 5 | import "examples/helloworld/helloworld.proto"; 6 | 7 | service Forward { 8 | rpc Route (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 9 | 10 | rpc ParallelRoute (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 11 | } -------------------------------------------------------------------------------- /examples/features/redis/client/fiber/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "fiber_client", 3 | srcs = ["fiber_client.cc"], 4 | linkopts = ["-ldl"], 5 | deps = [ 6 | "@com_github_gflags_gflags//:gflags", 7 | "@trpc_cpp//trpc/client:client_context", 8 | "@trpc_cpp//trpc/client:make_client_context", 9 | "@trpc_cpp//trpc/client:trpc_client", 10 | "@trpc_cpp//trpc/client/redis:redis_service_proxy", 11 | "@trpc_cpp//trpc/client/redis:reply", 12 | "@trpc_cpp//trpc/common:runtime_manager", 13 | "@trpc_cpp//trpc/common:trpc_plugin", 14 | "@trpc_cpp//trpc/coroutine:fiber", 15 | "@trpc_cpp//trpc/util:latch", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /examples/features/redis/client/future/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "future_client", 3 | srcs = ["future_client.cc"], 4 | linkopts = ["-ldl"], 5 | deps = [ 6 | "@com_github_gflags_gflags//:gflags", 7 | "@trpc_cpp//trpc/client:client_context", 8 | "@trpc_cpp//trpc/client:make_client_context", 9 | "@trpc_cpp//trpc/client:trpc_client", 10 | "@trpc_cpp//trpc/client/redis:redis_service_proxy", 11 | "@trpc_cpp//trpc/client/redis:reply", 12 | "@trpc_cpp//trpc/common:runtime_manager", 13 | "@trpc_cpp//trpc/common:trpc_plugin", 14 | "@trpc_cpp//trpc/future:future_utility", 15 | ], 16 | ) -------------------------------------------------------------------------------- /examples/features/request_dispatch/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/request_dispatch/client/trpc_cpp_future.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: merge 6 | io_thread_num: 4 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/features/request_dispatch/server/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "demo_server", 3 | srcs = ["demo_server.cc"], 4 | deps = [ 5 | "//examples/helloworld:helloworld_proto", 6 | "@com_github_fmtlib_fmt//:fmtlib", 7 | "@trpc_cpp//trpc/common:trpc_app", 8 | "@trpc_cpp//trpc/codec/trpc:trpc_protocol", 9 | "@trpc_cpp//trpc/log:trpc_log", 10 | "@trpc_cpp//trpc/runtime/threadmodel/common:worker_thread", 11 | "@trpc_cpp//trpc/util/algorithm:random", 12 | "@trpc_cpp//trpc/util/buffer:zero_copy_stream", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /examples/features/request_dispatch/server/trpc_cpp_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: separate 6 | io_thread_num: 2 7 | handle_thread_num: 8 8 | 9 | server: 10 | app: test 11 | server: helloworld 12 | service: 13 | - name: trpc.test.helloworld.Greeter 14 | protocol: trpc 15 | network: tcp 16 | ip: 0.0.0.0 17 | port: 12353 18 | 19 | plugins: 20 | log: 21 | default: 22 | - name: default 23 | sinks: 24 | local_file: 25 | filename: request_dispatch_in_separate.log -------------------------------------------------------------------------------- /examples/features/rpcz/client/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "client", 7 | srcs = ["client.cc"], 8 | linkopts = ["-ldl"], 9 | deps = [ 10 | "//examples/features/rpcz/proxy:rpcz_proto", 11 | "@trpc_cpp//trpc/client:make_client_context", 12 | "@trpc_cpp//trpc/client:trpc_client", 13 | "@trpc_cpp//trpc/common:runtime_manager", 14 | "@trpc_cpp//trpc/common:trpc_plugin", 15 | "@trpc_cpp//trpc/common/config:trpc_config", 16 | "@trpc_cpp//trpc/future:future_utility", 17 | "@trpc_cpp//trpc/util/log:logging", 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /examples/features/rpcz/client/trpc_cpp_client.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | enable_version_report: false 4 | threadmodel: 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: rpcz_client 13 | selector_name: direct 14 | target: 127.0.0.1:15001 15 | protocol: trpc 16 | network: tcp 17 | conn_type: long 18 | is_conn_complex: true 19 | timeout: 1000 20 | -------------------------------------------------------------------------------- /examples/features/rpcz/proxy/rpcz.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.examples.rpcz; 4 | 5 | import "examples/helloworld/helloworld.proto"; 6 | 7 | service Rpcz { 8 | // Client rpcz / server rpcz. 9 | rpc Normal (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 10 | // Route rpcz. 11 | rpc Route (trpc.test.helloworld.HelloRequest) returns (trpc.test.helloworld.HelloReply) {} 12 | } 13 | -------------------------------------------------------------------------------- /examples/features/rpcz/proxy/rpcz_proxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/common/trpc_app.h" 17 | 18 | namespace trpc::examples { 19 | 20 | class RpczServer: public trpc::TrpcApp { 21 | public: 22 | int Initialize() override; 23 | 24 | void Destroy() override; 25 | }; 26 | 27 | } // namespace trpc::examples 28 | -------------------------------------------------------------------------------- /examples/features/thirdparty_protocol/client/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "client", 3 | srcs = ["client.cc"], 4 | deps = [ 5 | "//examples/features/thirdparty_protocol/common:demo_client_codec", 6 | "//examples/features/thirdparty_protocol/common:demo_protocol", 7 | "@com_github_gflags_gflags//:gflags", 8 | "@trpc_cpp//trpc/client:make_client_context", 9 | "@trpc_cpp//trpc/client:non_rpc_service_proxy", 10 | "@trpc_cpp//trpc/common:runtime_manager", 11 | "@trpc_cpp//trpc/client:trpc_client", 12 | "@trpc_cpp//trpc/common:trpc_plugin", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /examples/features/thirdparty_protocol/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/thirdparty_protocol/run.sh: -------------------------------------------------------------------------------- 1 | bazel build //examples/features/thirdparty_protocol/... 2 | 3 | echo "begin" 4 | ./bazel-bin/examples/features/thirdparty_protocol/server/demo_server --config=./examples/features/thirdparty_protocol/server/trpc_cpp_fiber.yaml & 5 | sleep 1 6 | ./bazel-bin/examples/features/thirdparty_protocol/client/client --client_config=./examples/features/thirdparty_protocol/client/trpc_cpp_fiber.yaml 7 | killall demo_server 8 | -------------------------------------------------------------------------------- /examples/features/thirdparty_protocol/run_cmake.sh: -------------------------------------------------------------------------------- 1 | mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 2 | mkdir -p examples/features/thirdparty_protocol/build && cd examples/features/thirdparty_protocol/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 3 | 4 | echo "begin" 5 | examples/features/thirdparty_protocol/build/demo_server --config=./examples/features/thirdparty_protocol/server/trpc_cpp_fiber.yaml & 6 | sleep 1 7 | examples/features/thirdparty_protocol/build/client --client_config=./examples/features/thirdparty_protocol/client/trpc_cpp_fiber.yaml 8 | killall demo_server 9 | -------------------------------------------------------------------------------- /examples/features/thirdparty_protocol/server/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "demo_server", 5 | srcs = ["demo_server.cc"], 6 | linkopts = [ 7 | "-ldl", 8 | ], 9 | deps = [ 10 | "//examples/features/thirdparty_protocol/common:demo_protocol", 11 | "//examples/features/thirdparty_protocol/common:demo_server_codec", 12 | "@trpc_cpp//trpc/common:trpc_app", 13 | "@trpc_cpp//trpc/common:trpc_plugin", 14 | "@trpc_cpp//trpc/server:method", 15 | "@trpc_cpp//trpc/server:non_rpc_method_handler", 16 | "@trpc_cpp//trpc/server:non_rpc_service_impl", 17 | "@trpc_cpp//trpc/server:non_rpc_service_method", 18 | ], 19 | ) -------------------------------------------------------------------------------- /examples/features/trpc_async_stream/server/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "trpc_async_stream_server", 7 | srcs = ["stream_server.cc"], 8 | linkopts = [ 9 | "-ldl", 10 | ], 11 | deps = [ 12 | ":stream_service", 13 | "@trpc_cpp//trpc/common:trpc_app", 14 | "@trpc_cpp//trpc/util/log:logging", 15 | ], 16 | ) 17 | 18 | cc_library( 19 | name = "stream_service", 20 | srcs = ["stream_service.cc"], 21 | hdrs = ["stream_service.h"], 22 | deps = [ 23 | "//examples/features/trpc_stream/server:stream_proto", 24 | "@trpc_cpp//trpc/common:status", 25 | "@trpc_cpp//trpc/util/log:logging", 26 | ], 27 | ) -------------------------------------------------------------------------------- /examples/features/trpc_attachment/client/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "client", 5 | srcs = ["client.cc"], 6 | linkopts = ["-ldl"], 7 | deps = [ 8 | "//examples/helloworld:helloworld_proto", 9 | "@com_github_gflags_gflags//:gflags", 10 | "@trpc_cpp//trpc/client:make_client_context", 11 | "@trpc_cpp//trpc/client:trpc_client", 12 | "@trpc_cpp//trpc/common:runtime_manager", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /examples/features/trpc_attachment/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/trpc_attachment/run.sh: -------------------------------------------------------------------------------- 1 | bazel build //examples/features/trpc_attachment/... 2 | 3 | ./bazel-bin/examples/features/trpc_attachment/server/demo_server --config=./examples/features/trpc_attachment/server/trpc_cpp_fiber.yaml & 4 | sleep 1 5 | ./bazel-bin/examples/features/trpc_attachment/client/client --client_config=./examples/features/trpc_attachment/client/trpc_cpp_fiber.yaml 6 | 7 | killall demo_server 8 | -------------------------------------------------------------------------------- /examples/features/trpc_attachment/run_cmake.sh: -------------------------------------------------------------------------------- 1 | mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 2 | mkdir -p examples/features/trpc_attachment/build && cd examples/features/trpc_attachment/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 3 | 4 | examples/features/trpc_attachment/build/demo_server --config=./examples/features/trpc_attachment/server/trpc_cpp_fiber.yaml & 5 | sleep 1 6 | examples/features/trpc_attachment/build/client --client_config=./examples/features/trpc_attachment/client/trpc_cpp_fiber.yaml 7 | 8 | killall demo_server 9 | -------------------------------------------------------------------------------- /examples/features/trpc_attachment/server/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "demo_server", 3 | srcs = ["demo_server.cc"], 4 | deps = [ 5 | "//examples/helloworld:helloworld_proto", 6 | "@com_github_fmtlib_fmt//:fmtlib", 7 | "@trpc_cpp//trpc/common:trpc_app", 8 | "@trpc_cpp//trpc/log:trpc_log", 9 | ], 10 | ) 11 | -------------------------------------------------------------------------------- /examples/features/trpc_compressor/client/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "client", 5 | srcs = ["client.cc"], 6 | linkopts = ["-ldl"], 7 | deps = [ 8 | "//examples/helloworld:helloworld_proto", 9 | "@com_github_gflags_gflags//:gflags", 10 | "@trpc_cpp//trpc/client:make_client_context", 11 | "@trpc_cpp//trpc/client:trpc_client", 12 | "@trpc_cpp//trpc/common:runtime_manager", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /examples/features/trpc_compressor/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/trpc_compressor/run.sh: -------------------------------------------------------------------------------- 1 | bazel build //examples/helloworld/... 2 | bazel build //examples/features/trpc_compressor/... 3 | 4 | ./bazel-bin/examples/helloworld/helloworld_svr --config=./examples/helloworld/conf/trpc_cpp_fiber.yaml & 5 | sleep 1 6 | ./bazel-bin/examples/features/trpc_compressor/client/client --client_config=./examples/features/trpc_compressor/client/trpc_cpp_fiber.yaml 7 | 8 | killall helloworld_svr 9 | -------------------------------------------------------------------------------- /examples/features/trpc_compressor/run_cmake.sh: -------------------------------------------------------------------------------- 1 | mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 2 | mkdir -p examples/helloworld/build && cd examples/helloworld/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 3 | mkdir -p examples/features/trpc_compressor/build && cd examples/features/trpc_compressor/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 4 | 5 | examples/helloworld/build/helloworld_svr --config=./examples/helloworld/conf/trpc_cpp_fiber.yaml & 6 | sleep 1 7 | examples/features/trpc_compressor/build/client --client_config=./examples/features/trpc_compressor/client/trpc_cpp_fiber.yaml 8 | 9 | killall helloworld_svr 10 | -------------------------------------------------------------------------------- /examples/features/trpc_flatbuffers/client/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "client", 5 | srcs = ["client.cc"], 6 | deps = [ 7 | "//examples/features/trpc_flatbuffers/proxy:forward_fbs", 8 | "@com_github_gflags_gflags//:gflags", 9 | "@trpc_cpp//trpc/client:client_context", 10 | "@trpc_cpp//trpc/client:make_client_context", 11 | "@trpc_cpp//trpc/common:runtime_manager", 12 | "@trpc_cpp//trpc/client:trpc_client", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /examples/features/trpc_flatbuffers/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/trpc_flatbuffers/proxy/forward.fbs: -------------------------------------------------------------------------------- 1 | include "greeter.fbs"; 2 | 3 | namespace trpc.test.forward; 4 | 5 | rpc_service FbForward { 6 | Forward(trpc.test.helloworld.FbRequest):trpc.test.helloworld.FbReply; 7 | } 8 | -------------------------------------------------------------------------------- /examples/features/trpc_flatbuffers/proxy/greeter.fbs: -------------------------------------------------------------------------------- 1 | namespace trpc.test.helloworld; 2 | 3 | table FbReply { 4 | message:string; 5 | } 6 | 7 | table FbRequest { 8 | message:string; 9 | } 10 | 11 | rpc_service FbGreeter { 12 | SayHello(FbRequest):FbReply; 13 | } 14 | -------------------------------------------------------------------------------- /examples/features/trpc_flatbuffers/run.sh: -------------------------------------------------------------------------------- 1 | bazel build //examples/features/trpc_flatbuffers/... 2 | 3 | echo "begin" 4 | ./bazel-bin/examples/features/trpc_flatbuffers/server/demoserver --config=./examples/features/trpc_flatbuffers/server/trpc_cpp_fiber.yaml & 5 | sleep 1 6 | ./bazel-bin/examples/features/trpc_flatbuffers/proxy/forwardserver --config=./examples/features/trpc_flatbuffers/proxy/trpc_cpp_fiber.yaml & 7 | sleep 1 8 | ./bazel-bin/examples/features/trpc_flatbuffers/client/client --client_config=./examples/features/trpc_flatbuffers/client/trpc_cpp_fiber.yaml 9 | killall demoserver 10 | killall forwardserver 11 | -------------------------------------------------------------------------------- /examples/features/trpc_flatbuffers/server/greeter.fbs: -------------------------------------------------------------------------------- 1 | namespace trpc.test.helloworld; 2 | 3 | table FbReply { 4 | message:string; 5 | } 6 | 7 | table FbRequest { 8 | message:string; 9 | } 10 | 11 | rpc_service FbGreeter { 12 | SayHello(FbRequest):FbReply; 13 | } 14 | -------------------------------------------------------------------------------- /examples/features/trpc_json/client/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "client", 3 | srcs = ["client.cc"], 4 | deps = [ 5 | "@com_github_gflags_gflags//:gflags", 6 | "@com_github_tencent_rapidjson//:rapidjson", 7 | "@trpc_cpp//trpc/client:make_client_context", 8 | "@trpc_cpp//trpc/client:rpc_service_proxy", 9 | "@trpc_cpp//trpc/common:runtime_manager", 10 | "@trpc_cpp//trpc/client:trpc_client", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /examples/features/trpc_json/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/trpc_json/run.sh: -------------------------------------------------------------------------------- 1 | bazel build //examples/features/trpc_json/... 2 | 3 | echo "begin" 4 | ./bazel-bin/examples/features/trpc_json/server/demo_server --config=./examples/features/trpc_json/server/trpc_cpp_fiber.yaml & 5 | sleep 1 6 | ./bazel-bin/examples/features/trpc_json/client/client --client_config=./examples/features/trpc_json/client/trpc_cpp_fiber.yaml 7 | killall demo_server 8 | -------------------------------------------------------------------------------- /examples/features/trpc_json/run_cmake.sh: -------------------------------------------------------------------------------- 1 | mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 2 | mkdir -p examples/features/trpc_json/build && cd examples/features/trpc_json/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 3 | 4 | echo "begin" 5 | examples/features/trpc_json/build/demo_server --config=./examples/features/trpc_json/server/trpc_cpp_fiber.yaml & 6 | sleep 1 7 | examples/features/trpc_json/build/client --client_config=./examples/features/trpc_json/client/trpc_cpp_fiber.yaml 8 | killall demo_server 9 | -------------------------------------------------------------------------------- /examples/features/trpc_json/server/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "demo_server", 5 | srcs = ["demo_server.cc"], 6 | linkopts = [ 7 | "-ldl", 8 | ], 9 | deps = [ 10 | "@trpc_cpp//trpc/common:trpc_app", 11 | "@trpc_cpp//trpc/log:trpc_log", 12 | "@trpc_cpp//trpc/server:rpc_method_handler", 13 | "@trpc_cpp//trpc/server:rpc_service_impl", 14 | "@trpc_cpp//trpc/server:rpc_service_method", 15 | ], 16 | ) -------------------------------------------------------------------------------- /examples/features/trpc_noop/client/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "client", 3 | srcs = ["client.cc"], 4 | deps = [ 5 | "@com_github_gflags_gflags//:gflags", 6 | "@trpc_cpp//trpc/client:make_client_context", 7 | "@trpc_cpp//trpc/client:rpc_service_proxy", 8 | "@trpc_cpp//trpc/common:runtime_manager", 9 | "@trpc_cpp//trpc/client:trpc_client", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /examples/features/trpc_noop/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/trpc_noop/run.sh: -------------------------------------------------------------------------------- 1 | bazel build //examples/features/trpc_noop/... 2 | 3 | echo "begin" 4 | ./bazel-bin/examples/features/trpc_noop/server/demo_server --config=./examples/features/trpc_noop/server/trpc_cpp_fiber.yaml & 5 | sleep 1 6 | ./bazel-bin/examples/features/trpc_noop/client/client --client_config=./examples/features/trpc_noop/client/trpc_cpp_fiber.yaml 7 | killall demo_server 8 | -------------------------------------------------------------------------------- /examples/features/trpc_noop/run_cmake.sh: -------------------------------------------------------------------------------- 1 | mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 2 | mkdir -p examples/features/trpc_noop/build && cd examples/features/trpc_noop/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && cd - 3 | 4 | echo "begin" 5 | examples/features/trpc_noop/build/demo_server --config=./examples/features/trpc_noop/server/trpc_cpp_fiber.yaml & 6 | sleep 1 7 | examples/features/trpc_noop/build/client --client_config=./examples/features/trpc_noop/client/trpc_cpp_fiber.yaml 8 | killall demo_server 9 | -------------------------------------------------------------------------------- /examples/features/trpc_noop/server/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "demo_server", 5 | srcs = ["demo_server.cc"], 6 | linkopts = [ 7 | "-ldl", 8 | ], 9 | deps = [ 10 | "@trpc_cpp//trpc/common:trpc_app", 11 | "@trpc_cpp//trpc/log:trpc_log", 12 | "@trpc_cpp//trpc/server:rpc_method_handler", 13 | "@trpc_cpp//trpc/server:rpc_service_impl", 14 | "@trpc_cpp//trpc/server:rpc_service_method", 15 | ], 16 | ) -------------------------------------------------------------------------------- /examples/features/trpc_stream/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/trpc_stream/server/stream.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.helloworld; 4 | 5 | service StreamGreeter { 6 | // Client streaming 7 | rpc ClientStreamSayHello (stream HelloRequest) returns (HelloReply) {} 8 | 9 | // Server streaming 10 | rpc ServerStreamSayHello (HelloRequest) returns (stream HelloReply) {} 11 | 12 | // Bidi streaming 13 | rpc BidiStreamSayHello (stream HelloRequest) returns (stream HelloReply) {} 14 | } 15 | 16 | message HelloRequest { 17 | string msg = 1; 18 | } 19 | 20 | message HelloReply { 21 | string msg = 1; 22 | } 23 | -------------------------------------------------------------------------------- /examples/features/trpc_stream_forward/client/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "client", 7 | srcs = ["client.cc"], 8 | linkopts = ["-ldl"], 9 | deps = [ 10 | "//examples/features/trpc_stream_forward/proxy:stream_forward_proto", 11 | "@trpc_cpp//trpc/client:make_client_context", 12 | "@trpc_cpp//trpc/client:trpc_client", 13 | "@trpc_cpp//trpc/common:runtime_manager", 14 | "@trpc_cpp//trpc/common:status", 15 | "@trpc_cpp//trpc/common:trpc_plugin", 16 | "@trpc_cpp//trpc/common/config:trpc_config", 17 | "@trpc_cpp//trpc/coroutine:fiber", 18 | "@trpc_cpp//trpc/util/log:logging", 19 | ], 20 | ) 21 | -------------------------------------------------------------------------------- /examples/features/trpc_stream_forward/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/trpc_stream_forward/proxy/stream_forward.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.helloworld; 4 | 5 | import "examples/features/trpc_stream/server/stream.proto"; 6 | 7 | service StreamForward { 8 | // Client streaming 9 | rpc ClientStreamSayHello (stream HelloRequest) returns (HelloReply) {} 10 | 11 | // Server streaming 12 | rpc ServerStreamSayHello (HelloRequest) returns (stream HelloReply) {} 13 | 14 | // Bidi streaming 15 | rpc BidiStreamSayHello (stream HelloRequest) returns (stream HelloReply) {} 16 | } -------------------------------------------------------------------------------- /examples/features/trpc_transparent/client/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "client", 5 | srcs = ["client.cc"], 6 | linkopts = ["-ldl"], 7 | deps = [ 8 | "//examples/helloworld:helloworld_proto", 9 | "@com_github_gflags_gflags//:gflags", 10 | "@trpc_cpp//trpc/client:make_client_context", 11 | "@trpc_cpp//trpc/client:trpc_client", 12 | "@trpc_cpp//trpc/common:runtime_manager", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /examples/features/trpc_transparent/client/trpc_cpp_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | scheduling_group_size: 4 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /examples/features/tvar/client/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "client", 7 | srcs = ["client.cc"], 8 | linkopts = ["-ldl"], 9 | deps = [ 10 | "//examples/features/tvar/server:tvar_proto", 11 | "@trpc_cpp//trpc/client:make_client_context", 12 | "@trpc_cpp//trpc/client:trpc_client", 13 | "@trpc_cpp//trpc/common:runtime_manager", 14 | "@trpc_cpp//trpc/common:trpc_plugin", 15 | "@trpc_cpp//trpc/common/config:trpc_config", 16 | "@trpc_cpp//trpc/util/log:logging", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /examples/features/tvar/client/trpc_cpp_client.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 4 8 | 9 | client: 10 | service: 11 | - name: tvar_client 12 | selector_name: direct 13 | target: 127.0.0.1:13001 14 | protocol: trpc 15 | network: tcp 16 | conn_type: long 17 | -------------------------------------------------------------------------------- /examples/helloworld/helloworld.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.helloworld; 4 | 5 | service Greeter { 6 | rpc SayHello (HelloRequest) returns (HelloReply) {} 7 | } 8 | 9 | message HelloRequest { 10 | string msg = 1; 11 | } 12 | 13 | message HelloReply { 14 | string msg = 1; 15 | } 16 | -------------------------------------------------------------------------------- /examples/helloworld/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bazel build //examples/helloworld/... 4 | 5 | echo "testing server at fiber runtime" 6 | ./bazel-bin/examples/helloworld/helloworld_svr --config=./examples/helloworld/conf/trpc_cpp_fiber.yaml & 7 | sleep 1 8 | ./bazel-bin/examples/helloworld/test/fiber_client --client_config=./examples/helloworld/test/conf/trpc_cpp_fiber.yaml 9 | killall helloworld_svr 10 | echo "testing server at thread runtime" 11 | ./bazel-bin/examples/helloworld/helloworld_svr --config=./examples/helloworld/conf/trpc_cpp.yaml & 12 | sleep 1 13 | ./bazel-bin/examples/helloworld/test/future_client --client_config=./examples/helloworld/test/conf/trpc_cpp_future.yaml 14 | killall helloworld_svr 15 | -------------------------------------------------------------------------------- /examples/unittest/BUILD: -------------------------------------------------------------------------------- 1 | load("//trpc:trpc.bzl", "trpc_proto_library") 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | trpc_proto_library( 8 | name = "helloworld_proto", 9 | srcs = ["helloworld.proto"], 10 | generate_mock_code = True, 11 | use_trpc_plugin = True, 12 | ) 13 | -------------------------------------------------------------------------------- /examples/unittest/client/trpc_cpp.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: separate 6 | io_thread_num: 2 7 | handle_thread_num: 6 8 | 9 | client: 10 | service: 11 | - name: trpc.test.unittest.Greeter 12 | protocol: trpc 13 | network: tcp 14 | target: 0.0.0.0:12345 15 | selector_name: direct 16 | 17 | plugins: 18 | log: 19 | default: 20 | - name: default 21 | min_level: 1 # 0-trace, 1-debug, 2-info, 3-warn, 4-error, 5-critical 22 | sinks: 23 | local_file: 24 | filename: client.log -------------------------------------------------------------------------------- /examples/unittest/helloworld.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.unittest; 4 | 5 | service Greeter { 6 | // Demo for asynchronous response 7 | rpc SayHello (HelloRequest) returns (HelloReply) {} 8 | } 9 | 10 | message HelloRequest { 11 | string msg = 1; 12 | } 13 | 14 | message HelloReply { 15 | string msg = 1; 16 | } 17 | -------------------------------------------------------------------------------- /examples/unittest/server/async/trpc_cpp.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: separate 6 | io_thread_num: 2 7 | handle_thread_num: 6 8 | 9 | server: 10 | app: test 11 | server: unittest 12 | service: 13 | - name: trpc.test.unittest.Greeter 14 | protocol: trpc 15 | network: tcp 16 | ip: 0.0.0.0 17 | port: 12345 18 | 19 | plugins: 20 | log: 21 | default: 22 | - name: default 23 | min_level: 1 # 0-trace, 1-debug, 2-info, 3-warn, 4-error, 5-critical 24 | sinks: 25 | local_file: 26 | filename: server.log 27 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/test/README.md -------------------------------------------------------------------------------- /test/end2end/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/test/end2end/BUILD -------------------------------------------------------------------------------- /test/end2end/README.md: -------------------------------------------------------------------------------- 1 | # end2end testing -------------------------------------------------------------------------------- /test/end2end/gracefully_stop/README.md: -------------------------------------------------------------------------------- 1 | ### trpc-cpp gracefully stop end2end testing 2 | 3 | Mainly, it simulates scenarios where the process receives the SIGUSR2 signal (kill -12 pid) in the server (helloworld directory) and relay (forward directory) scenarios. The goal is to check if the process can gracefully exit without crashing and without generating a core dump -------------------------------------------------------------------------------- /test/end2end/gracefully_stop/run_test.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | function check_success { 4 | if [ $1 -ne 0 ]; then 5 | echo "Failed" 6 | exit -1 7 | fi 8 | } 9 | 10 | cd helloworld 11 | chmod +x run_test.sh 12 | ./run_test.sh 13 | check_success $? 14 | 15 | cd ../forward 16 | chmod +x run_test.sh 17 | ./run_test.sh 18 | check_success $? -------------------------------------------------------------------------------- /test/end2end/stream/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/test/end2end/stream/BUILD -------------------------------------------------------------------------------- /test/end2end/stream/trpc/async_stream_server.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, Tencent Inc. 2 | // All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include "test/end2end/common/test_signaller.h" 7 | #include "trpc/common/trpc_app.h" 8 | 9 | namespace trpc::testing { 10 | 11 | /// @brief Streaming server (using asynchronous stream interface). 12 | class AsyncStreamServer : public ::trpc::TrpcApp { 13 | public: 14 | explicit AsyncStreamServer(TestSignaller* test_signal) : test_signal_(test_signal) {} 15 | int Initialize() override; 16 | void Destroy() override; 17 | 18 | private: 19 | TestSignaller* test_signal_{nullptr}; 20 | }; 21 | 22 | } // namespace trpc::testing 23 | -------------------------------------------------------------------------------- /test/end2end/stream/trpc/conf/BUILD: -------------------------------------------------------------------------------- 1 | filegroup( 2 | name = "unit_test_resources", 3 | testonly = 1, 4 | srcs = glob( 5 | [ 6 | "async_test/*.yaml", 7 | "sync_test/*.yaml", 8 | ], 9 | exclude_directories = 0, 10 | ), 11 | visibility = [ 12 | "//visibility:public", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /test/end2end/stream/trpc/conf/async_test/async_stream_server.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: merge 6 | io_thread_num: 4 7 | 8 | server: 9 | app: testing 10 | server: stream_test 11 | service: 12 | - name: trpc.testing.stream_test.AsyncStreamService 13 | protocol: trpc 14 | port: 13217 15 | - name: trpc.testing.stream_test.AsyncStreamServiceConnIdle 16 | protocol: trpc 17 | port: 13219 18 | idle_time: 2000 19 | -------------------------------------------------------------------------------- /test/end2end/stream/trpc/conf/async_test/sync_stream_server.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | 7 | server: 8 | app: testing 9 | server: stream_test 10 | service: 11 | - name: trpc.testing.stream_test.SyncStreamService 12 | protocol: trpc 13 | port: 13216 14 | - name: trpc.testing.stream_test.SyncStreamServiceConnIdle 15 | protocol: trpc 16 | port: 13218 17 | idle_time: 2000 18 | - name: trpc.testing.stream_test.SyncStreamServiceNoFlowControl 19 | protocol: trpc 20 | port: 13220 21 | stream_max_window_size: 0 22 | -------------------------------------------------------------------------------- /test/end2end/stream/trpc/conf/sync_test/async_stream_server.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: merge 6 | io_thread_num: 4 7 | 8 | server: 9 | app: testing 10 | server: stream_test 11 | service: 12 | - name: trpc.testing.stream_test.AsyncStreamService 13 | protocol: trpc 14 | port: 14217 15 | - name: trpc.testing.stream_test.AsyncStreamServiceConnIdle 16 | protocol: trpc 17 | port: 14219 18 | idle_time: 2000 19 | -------------------------------------------------------------------------------- /test/end2end/stream/trpc/conf/sync_test/sync_stream_server.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 4 6 | 7 | server: 8 | app: testing 9 | server: stream_test 10 | service: 11 | - name: trpc.testing.stream_test.SyncStreamService 12 | protocol: trpc 13 | port: 14216 14 | - name: trpc.testing.stream_test.SyncStreamServiceConnIdle 15 | protocol: trpc 16 | port: 14218 17 | idle_time: 2000 18 | - name: trpc.testing.stream_test.SyncStreamServiceNoFlowControl 19 | protocol: trpc 20 | port: 14220 21 | stream_max_window_size: 0 22 | -------------------------------------------------------------------------------- /test/end2end/stream/trpc/sync_stream_server.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, Tencent Inc. 2 | // All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include "test/end2end/common/test_signaller.h" 7 | #include "trpc/common/trpc_app.h" 8 | 9 | namespace trpc::testing { 10 | 11 | /// @brief Streaming server (using synchronous stream interface). 12 | class SyncStreamServer : public ::trpc::TrpcApp { 13 | public: 14 | explicit SyncStreamServer(TestSignaller* test_signal) : test_signal_(test_signal) {} 15 | int Initialize() override; 16 | void Destroy() override; 17 | 18 | private: 19 | TestSignaller* test_signal_{nullptr}; 20 | }; 21 | 22 | } // namespace trpc::testing 23 | -------------------------------------------------------------------------------- /test/end2end/unary/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/test/end2end/unary/BUILD -------------------------------------------------------------------------------- /test/end2end/unary/fiber/README.md: -------------------------------------------------------------------------------- 1 | # end2end testing 2 | ## unary 3 | ### fiber 4 | Dode directory organization: 5 | ```text 6 | test/end2end/unary/fiber/ 7 | |-- conf <- same code run with different config 8 | | `-- fiber_test 9 | | |-- BUILD 10 | | |-- fiber_client.yaml 11 | | `-- fiber_server.yaml 12 | |-- fiber.proto 13 | |-- fiber_server.cc 14 | |-- fiber_server.h 15 | `-- fiber_test.cc 16 | ``` -------------------------------------------------------------------------------- /test/end2end/unary/fiber/conf/fiber_test/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | ["*.yaml"], 8 | exclude_directories = 0, 9 | ), 10 | visibility = [ 11 | "//visibility:public", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /test/end2end/unary/fiber/conf/fiber_test/fiber_client.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | fiber: 5 | - instance_name: fiber_instance 6 | concurrency_hint: 8 7 | 8 | client: 9 | service: 10 | - name: fiber_client 11 | selector_name: direct 12 | target: 127.0.0.1:18000 13 | protocol: trpc 14 | network: tcp 15 | conn_type: long -------------------------------------------------------------------------------- /test/end2end/unary/fiber/conf/fiber_test/fiber_server.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | fiber: 5 | - instance_name: fiber_instance 6 | concurrency_hint: 8 7 | scheduling_group_size: 4 8 | 9 | server: 10 | app: test 11 | server: test1 12 | service: 13 | - name: fiber_service 14 | network: tcp 15 | ip: 127.0.0.1 16 | port: 18000 17 | protocol: trpc 18 | -------------------------------------------------------------------------------- /test/end2end/unary/future/README.md: -------------------------------------------------------------------------------- 1 | # end2end testing 2 | ## unary 3 | ### future 4 | Directory tree as shown below: 5 | ```text 6 | test/end2end/unary/future 7 | -- conf 8 | | |-- BUILD 9 | | |-- future_client_merge.yaml 10 | | |-- future_client_separate.yaml 11 | | |-- future_server_merge.yaml 12 | | |-- future_server_separate.yaml 13 | |-- BUILD 14 | |-- future_fixture.cc 15 | |-- future_fixture.h 16 | |-- future_server.cc 17 | |-- future_server.h 18 | |-- future_test.cc 19 | |-- future.proto 20 | |-- README.md 21 | ``` 22 | -------------------------------------------------------------------------------- /test/end2end/unary/future/conf/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | ["*.yaml"], 8 | exclude_directories = 0, 9 | ), 10 | ) 11 | -------------------------------------------------------------------------------- /test/end2end/unary/future/conf/future_server_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 4 8 | 9 | server: 10 | app: test 11 | server: test1 12 | service: 13 | - name: tcp_service 14 | protocol: trpc 15 | network: tcp 16 | ip: 0.0.0.0 17 | port: 14001 18 | - name: udp_service 19 | protocol: trpc 20 | network: udp 21 | ip: 0.0.0.0 22 | port: 14003 23 | -------------------------------------------------------------------------------- /test/end2end/unary/future/conf/future_server_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with client_separate, server no need to run in separate. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 4 9 | 10 | server: 11 | app: test 12 | server: test1 13 | service: 14 | - name: tcp_service 15 | protocol: trpc 16 | network: tcp 17 | ip: 0.0.0.0 18 | port: 14005 19 | - name: udp_service 20 | protocol: trpc 21 | network: udp 22 | ip: 0.0.0.0 23 | port: 14007 24 | -------------------------------------------------------------------------------- /test/end2end/unary/future/future.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.testing.future; 4 | 5 | service Future { 6 | rpc SayHello (TestRequest) returns (TestReply) {} 7 | rpc SayHelloTimeout (TestRequest) returns (TestReply) {} 8 | } 9 | 10 | message TestRequest { 11 | string msg = 1; 12 | } 13 | 14 | message TestReply { 15 | string msg = 1; 16 | } 17 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_rpc_test/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | ["*.yaml"], 8 | exclude_directories = 0, 9 | ), 10 | visibility = [ 11 | "//visibility:public", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_rpc_test/http_client_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 8 8 | 9 | client: 10 | service: 11 | - name: http_client 12 | selector_name: direct 13 | target: 127.0.0.1:16792 14 | protocol: http 15 | network: tcp 16 | conn_type: long 17 | - name: http_rpc_client 18 | selector_name: direct 19 | target: 127.0.0.1:16792 20 | protocol: http 21 | network: tcp 22 | conn_type: long 23 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_rpc_test/http_client_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: separate 7 | io_thread_num: 2 8 | handle_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: http_client 13 | selector_name: direct 14 | target: 127.0.0.1:16793 15 | protocol: http 16 | network: tcp 17 | conn_type: long 18 | - name: http_rpc_client 19 | selector_name: direct 20 | target: 127.0.0.1:16793 21 | protocol: http 22 | network: tcp 23 | conn_type: long 24 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_rpc_test/http_server_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 8 8 | 9 | server: 10 | app: test 11 | server: test1 12 | service: 13 | - name: http_rpc_service 14 | network: tcp 15 | ip: 0.0.0.0 16 | port: 16792 17 | protocol: http 18 | 19 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_rpc_test/http_server_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: separate 7 | io_thread_num: 2 8 | handle_thread_num: 4 9 | 10 | server: 11 | app: test 12 | server: test1 13 | service: 14 | - name: http_rpc_service 15 | network: tcp 16 | ip: 0.0.0.0 17 | port: 16793 18 | protocol: http 19 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_test/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | ["*.yaml"], 8 | exclude_directories = 0, 9 | ), 10 | visibility = [ 11 | "//visibility:public", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_test/http_client_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | fiber: 5 | - instance_name: fiber_instance 6 | concurrency_hint: 8 7 | 8 | client: 9 | service: 10 | - name: http_client 11 | selector_name: direct 12 | target: 127.0.0.1:16791 13 | protocol: http 14 | network: tcp 15 | conn_type: long 16 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_test/http_client_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 8 8 | 9 | client: 10 | service: 11 | - name: http_client 12 | selector_name: direct 13 | target: 127.0.0.1:16789 14 | protocol: http 15 | network: tcp 16 | conn_type: long 17 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_test/http_client_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: separate 7 | io_thread_num: 2 8 | handle_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: http_client 13 | selector_name: direct 14 | target: 127.0.0.1:16790 15 | protocol: http 16 | network: tcp 17 | conn_type: long 18 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_test/http_server_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | fiber: 5 | - instance_name: fiber_instance 6 | concurrency_hint: 8 7 | 8 | server: 9 | app: test 10 | server: test1 11 | service: 12 | - name: default_http_service 13 | network: tcp 14 | ip: 0.0.0.0 15 | port: 16791 16 | protocol: http 17 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_test/http_server_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 8 8 | 9 | server: 10 | app: test 11 | server: test1 12 | service: 13 | - name: default_http_service 14 | network: tcp 15 | ip: 0.0.0.0 16 | port: 16789 17 | protocol: http 18 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/http_test/http_server_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: separate 7 | io_thread_num: 2 8 | handle_thread_num: 4 9 | 10 | server: 11 | app: test 12 | server: test1 13 | service: 14 | - name: default_http_service 15 | network: tcp 16 | ip: 0.0.0.0 17 | port: 16790 18 | protocol: http 19 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/https_test/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | [ 8 | "*.yaml", 9 | "*.pem", 10 | "ca*/server.*", 11 | ], 12 | exclude_directories = 0, 13 | ), 14 | visibility = [ 15 | "//visibility:public", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /test/end2end/unary/http/conf/https_test/dhparam.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEAnMcSkTzUn1MrECQqZWO4/PsOlpmScZ0zGtKueDanUtSNZfVymkqi 3 | 5SdLefAocDpvbdP5caGpAGrVRxAk3M6Qw4fl05cCoJNAHBRDiDpRq6Py1HbNJ6D0 4 | QZUtZMt3ZaGGTKIo5uk5EoPaxxyJG/2TvEgkn25TEJyuP8qE82Ou5s/Gv7Z4kC9i 5 | yyKZXVbYc/YKkpz5u0pAnVwjYLMbHZ+W/hTI6zqv7UF3YM4Kpc9Z86HOZxxPwLqA 6 | /NBNlMj9GgwODKiiK+pYSY58JO6ApGmwVrry6Mi9tCKHWH/3iHdaypcA5SaGhDHL 7 | 5JSkeSQhsDh1aLaSZP4bwjCo8S+uyJyEmwIBAg== 8 | -----END DH PARAMETERS----- 9 | -------------------------------------------------------------------------------- /test/end2end/unary/http/http_rpc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.testing.httpsvr; 4 | 5 | import "trpc/proto/trpc_options.proto"; 6 | 7 | service HttpRpcService { 8 | rpc TestPb (TestRequest) returns (TestReply) { 9 | option (trpc.alias) = "/test-pb"; 10 | } 11 | 12 | rpc TestPbEmptyReq (TestRequest) returns (TestReply) {} 13 | 14 | rpc TestPbEmptyRsp (TestRequest) returns (TestReply) {} 15 | 16 | rpc TestPbRetErr (TestRequest) returns (TestReply) {} 17 | } 18 | 19 | message TestRequest { 20 | string msg = 1; 21 | } 22 | 23 | message TestReply { 24 | string msg = 1; 25 | } 26 | -------------------------------------------------------------------------------- /test/end2end/unary/redis/conf/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | ["*.yaml"], 8 | exclude_directories = 0, 9 | ), 10 | visibility = [ 11 | "//visibility:public", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /test/end2end/unary/redis/conf/redis_client_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | coroutine: 4 | enable: true 5 | threadmodel: 6 | fiber: 7 | - instance_name: fiber_instance 8 | concurrency_hint: 8 9 | 10 | client: 11 | service: 12 | - name: redis_client 13 | selector_name: direct 14 | target: 0.0.0.0:6379 15 | protocol: redis 16 | network: tcp 17 | conn_type: long 18 | -------------------------------------------------------------------------------- /test/end2end/unary/redis/conf/redis_client_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 8 8 | 9 | client: 10 | service: 11 | - name: redis_client 12 | selector_name: direct 13 | target: 0.0.0.0:6379 14 | protocol: redis 15 | network: tcp 16 | conn_type: long 17 | -------------------------------------------------------------------------------- /test/end2end/unary/redis/conf/redis_client_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: separate 7 | io_thread_num: 2 8 | handle_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: redis_client 13 | selector_name: direct 14 | target: 0.0.0.0:6379 15 | protocol: redis 16 | network: tcp 17 | conn_type: long 18 | -------------------------------------------------------------------------------- /test/end2end/unary/redis/conf/redis_server.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | fiber: 5 | - instance_name: fiber_instance 6 | concurrency_hint: 8 7 | 8 | server: 9 | app: test 10 | server: test1 11 | service: 12 | ## for mock a redis-service 13 | - name: mock_redis_service 14 | network: tcp 15 | ip: 0.0.0.0 16 | port: 16790 17 | protocol: trpc 18 | -------------------------------------------------------------------------------- /test/end2end/unary/rpcz/conf/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | ["*.yaml"], 8 | exclude_directories = 0, 9 | ), 10 | ) 11 | -------------------------------------------------------------------------------- /test/end2end/unary/rpcz/conf/rpcz_client_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with proxy_fiber, client no need to run in fiber. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: rpcz_client 13 | selector_name: direct 14 | target: 127.0.0.1:15005 15 | protocol: trpc 16 | network: tcp 17 | conn_type: long 18 | is_conn_complex: true 19 | timeout: 1000 20 | - name: http_client 21 | selector_name: direct 22 | target: 127.0.0.1:32113 23 | protocol: http 24 | network: tcp 25 | conn_type: long 26 | timeout: 1000 27 | -------------------------------------------------------------------------------- /test/end2end/unary/rpcz/conf/rpcz_client_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 4 8 | 9 | client: 10 | service: 11 | - name: rpcz_client 12 | selector_name: direct 13 | target: 127.0.0.1:15001 14 | protocol: trpc 15 | network: tcp 16 | conn_type: long 17 | is_conn_complex: true 18 | timeout: 1000 19 | - name: http_client 20 | selector_name: direct 21 | target: 127.0.0.1:32111 22 | protocol: http 23 | network: tcp 24 | conn_type: long 25 | timeout: 1000 26 | -------------------------------------------------------------------------------- /test/end2end/unary/rpcz/conf/rpcz_client_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with proxy_separate, client no need to run in separate. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: rpcz_client 13 | selector_name: direct 14 | target: 127.0.0.1:15003 15 | protocol: trpc 16 | network: tcp 17 | conn_type: long 18 | is_conn_complex: true 19 | timeout: 1000 20 | - name: http_client 21 | selector_name: direct 22 | target: 127.0.0.1:32112 23 | protocol: http 24 | network: tcp 25 | conn_type: long 26 | timeout: 1000 27 | -------------------------------------------------------------------------------- /test/end2end/unary/rpcz/conf/rpcz_real_server_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with proxy_fiber, real server no need to run in fiber. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 2 9 | 10 | server: 11 | app: rpcz 12 | server: real 13 | service: 14 | - name: echo_service 15 | protocol: trpc 16 | network: tcp 17 | ip: 0.0.0.0 18 | port: 15006 19 | -------------------------------------------------------------------------------- /test/end2end/unary/rpcz/conf/rpcz_real_server_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 2 8 | 9 | server: 10 | app: rpcz 11 | server: real 12 | service: 13 | - name: echo_service 14 | protocol: trpc 15 | network: tcp 16 | ip: 0.0.0.0 17 | port: 15002 18 | -------------------------------------------------------------------------------- /test/end2end/unary/rpcz/conf/rpcz_real_server_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with proxy_fiber, real server no need to run in separate. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 2 9 | 10 | server: 11 | app: rpcz 12 | server: real 13 | service: 14 | - name: echo_service 15 | protocol: trpc 16 | network: tcp 17 | ip: 0.0.0.0 18 | port: 15004 19 | -------------------------------------------------------------------------------- /test/end2end/unary/trpc/common_funcs.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, Tencent Inc. 2 | // All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include "trpc/coroutine/fiber.h" 7 | #include "trpc/runtime/runtime.h" 8 | 9 | namespace trpc::testing { 10 | 11 | void SleepFor(uint32_t ms) { 12 | if (::trpc::runtime::IsInFiberRuntime()) { 13 | ::trpc::FiberSleepFor(std::chrono::milliseconds(ms)); 14 | } else { 15 | std::this_thread::sleep_for(std::chrono::milliseconds(ms)); 16 | } 17 | } 18 | 19 | } // namespace trpc::testing 20 | -------------------------------------------------------------------------------- /test/end2end/unary/trpc/conf/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | ["*.yaml"], 8 | exclude_directories = 0, 9 | ), 10 | visibility = [ 11 | "//visibility:public", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /test/end2end/unary/trpc/trpc_route_server.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, Tencent Inc. 2 | // All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include "test/end2end/common/test_signaller.h" 7 | #include "trpc/common/trpc_app.h" 8 | 9 | namespace trpc::testing { 10 | 11 | /// @brief RouteServer for trpc unary test 12 | class RouteTestServer : public ::trpc::TrpcApp { 13 | public: 14 | explicit RouteTestServer(TestSignaller* test_signal) : test_signal_(test_signal) {} 15 | int Initialize() override; 16 | void Destroy() override; 17 | 18 | private: 19 | TestSignaller* test_signal_{nullptr}; 20 | }; 21 | 22 | } // namespace trpc::testing 23 | -------------------------------------------------------------------------------- /test/end2end/unary/trpc/trpc_server.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, Tencent Inc. 2 | // All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include "test/end2end/common/test_signaller.h" 7 | #include "trpc/common/trpc_app.h" 8 | 9 | namespace trpc::testing { 10 | 11 | /// @brief Server for trpc unary test 12 | class TrpcTestServer : public ::trpc::TrpcApp { 13 | public: 14 | explicit TrpcTestServer(TestSignaller* test_signal) : test_signal_(test_signal) {} 15 | int Initialize() override; 16 | void Destroy() override; 17 | 18 | private: 19 | TestSignaller* test_signal_{nullptr}; 20 | }; 21 | 22 | } // namespace trpc::testing 23 | -------------------------------------------------------------------------------- /test/end2end/unary/trpc/trpc_test.fbs: -------------------------------------------------------------------------------- 1 | namespace trpc.testing.unarytrpc; 2 | 3 | table FbsResponse { 4 | message:string; 5 | } 6 | 7 | enum FbsTestCaseType: byte { 8 | FORMAL = 0, // response normally 9 | INVALID_DATA = 1, // response with invalid data 10 | INVALID_TYPE = 2 // response with invalid data type 11 | } 12 | 13 | table FbsRequest { 14 | test_case_type:FbsTestCaseType; 15 | message:string; 16 | } 17 | 18 | rpc_service FbsTest { 19 | TestFbs(FbsRequest):FbsResponse; 20 | } 21 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "unit_test_resources", 5 | testonly = 1, 6 | srcs = glob( 7 | ["*.yaml"], 8 | exclude_directories = 0, 9 | ), 10 | visibility = [ 11 | "//visibility:public", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_client_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with server_fiber, client no need to run in fiber. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: http_client 13 | selector_name: direct 14 | target: 127.0.0.1:31115 15 | protocol: http 16 | network: tcp 17 | conn_type: long 18 | - name: tvar_client 19 | selector_name: direct 20 | target: 127.0.0.1:13005 21 | protocol: trpc 22 | network: tcp 23 | conn_type: long 24 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_client_fiber_noseries.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with server_fiber, client no need to run in fiber. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: http_client 13 | selector_name: direct 14 | target: 127.0.0.1:31116 15 | protocol: http 16 | network: tcp 17 | conn_type: long 18 | - name: tvar_client 19 | selector_name: direct 20 | target: 127.0.0.1:13006 21 | protocol: trpc 22 | network: tcp 23 | conn_type: long 24 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_client_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 4 8 | 9 | client: 10 | service: 11 | - name: http_client 12 | selector_name: direct 13 | target: 127.0.0.1:31111 14 | protocol: http 15 | network: tcp 16 | conn_type: long 17 | - name: tvar_client 18 | selector_name: direct 19 | target: 127.0.0.1:13001 20 | protocol: trpc 21 | network: tcp 22 | conn_type: long 23 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_client_merge_noseries.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 4 8 | 9 | client: 10 | service: 11 | - name: http_client 12 | selector_name: direct 13 | target: 127.0.0.1:31112 14 | protocol: http 15 | network: tcp 16 | conn_type: long 17 | - name: tvar_client 18 | selector_name: direct 19 | target: 127.0.0.1:13002 20 | protocol: trpc 21 | network: tcp 22 | conn_type: long 23 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_client_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with server_separate, client no need to run in separate. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: http_client 13 | selector_name: direct 14 | target: 127.0.0.1:31113 15 | protocol: http 16 | network: tcp 17 | conn_type: long 18 | - name: tvar_client 19 | selector_name: direct 20 | target: 127.0.0.1:13003 21 | protocol: trpc 22 | network: tcp 23 | conn_type: long 24 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_client_separate_noseries.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | # Just cooperate with server_separate, client no need to run in separate. 5 | default: 6 | - instance_name: default_instance 7 | io_handle_type: merge 8 | io_thread_num: 4 9 | 10 | client: 11 | service: 12 | - name: http_client 13 | selector_name: direct 14 | target: 127.0.0.1:31114 15 | protocol: http 16 | network: tcp 17 | conn_type: long 18 | - name: tvar_client 19 | selector_name: direct 20 | target: 127.0.0.1:13004 21 | protocol: trpc 22 | network: tcp 23 | conn_type: long 24 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_server_fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | coroutine: 4 | enable: true 5 | threadmodel: 6 | fiber: 7 | - instance_name: fiber_instance 8 | concurrency_hint: 8 9 | tvar: 10 | window_size: 10 11 | save_series: true 12 | latency_p1: 80 13 | latency_p2: 90 14 | latency_p3: 95 15 | 16 | server: 17 | app: test 18 | server: test1 19 | admin_ip: 0.0.0.0 20 | admin_port: 31115 21 | service: 22 | - name: tvar_service 23 | protocol: trpc 24 | network: tcp 25 | ip: 0.0.0.0 26 | port: 13005 27 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_server_fiber_noseries.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | coroutine: 4 | enable: true 5 | threadmodel: 6 | fiber: 7 | - instance_name: fiber_instance 8 | concurrency_hint: 8 9 | tvar: 10 | window_size: 10 11 | save_series: false 12 | latency_p1: 80 13 | latency_p2: 90 14 | latency_p3: 95 15 | 16 | server: 17 | app: test 18 | server: test1 19 | admin_ip: 0.0.0.0 20 | admin_port: 31116 21 | service: 22 | - name: tvar_service 23 | protocol: trpc 24 | network: tcp 25 | ip: 0.0.0.0 26 | port: 13006 27 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_server_merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 4 8 | tvar: 9 | window_size: 10 10 | save_series: true 11 | latency_p1: 80 12 | latency_p2: 90 13 | latency_p3: 95 14 | 15 | server: 16 | app: test 17 | server: test1 18 | admin_ip: 0.0.0.0 19 | admin_port: 31111 20 | service: 21 | - name: tvar_service 22 | protocol: trpc 23 | network: tcp 24 | ip: 0.0.0.0 25 | port: 13001 26 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_server_merge_noseries.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 4 8 | tvar: 9 | window_size: 10 10 | save_series: false 11 | latency_p1: 80 12 | latency_p2: 90 13 | latency_p3: 95 14 | 15 | server: 16 | app: test 17 | server: test1 18 | admin_ip: 0.0.0.0 19 | admin_port: 31112 20 | service: 21 | - name: tvar_service 22 | protocol: trpc 23 | network: tcp 24 | ip: 0.0.0.0 25 | port: 13002 26 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_server_separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: separate 7 | io_thread_num: 4 8 | handle_thread_num: 4 9 | tvar: 10 | window_size: 10 11 | save_series: true 12 | latency_p1: 80 13 | latency_p2: 90 14 | latency_p3: 95 15 | 16 | server: 17 | app: test 18 | server: test1 19 | admin_ip: 0.0.0.0 20 | admin_port: 31113 21 | service: 22 | - name: tvar_service 23 | protocol: trpc 24 | network: tcp 25 | ip: 0.0.0.0 26 | port: 13003 27 | -------------------------------------------------------------------------------- /test/end2end/unary/tvar/conf/tvar_server_separate_noseries.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: separate 7 | io_thread_num: 4 8 | handle_thread_num: 4 9 | tvar: 10 | window_size: 10 11 | save_series: false 12 | latency_p1: 80 13 | latency_p2: 90 14 | latency_p3: 95 15 | 16 | server: 17 | app: test 18 | server: test1 19 | admin_ip: 0.0.0.0 20 | admin_port: 31114 21 | service: 22 | - name: tvar_service 23 | protocol: trpc 24 | network: tcp 25 | ip: 0.0.0.0 26 | port: 13004 27 | -------------------------------------------------------------------------------- /third_party/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | -------------------------------------------------------------------------------- /third_party/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/README.md -------------------------------------------------------------------------------- /third_party/com_github_axboe_liburing/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_axboe_liburing/BUILD -------------------------------------------------------------------------------- /third_party/com_github_fmtlib_fmt/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_fmtlib_fmt/BUILD -------------------------------------------------------------------------------- /third_party/com_github_gabime_spdlog/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_gabime_spdlog/BUILD -------------------------------------------------------------------------------- /third_party/com_github_gabime_spdlog/spdlog.BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | default_visibility = ["//visibility:public"], 3 | ) 4 | 5 | cc_library( 6 | name = "spdlog", 7 | srcs = glob(["src/*.cpp"]), 8 | hdrs = glob([ 9 | "include/spdlog/*.h", 10 | "include/spdlog/*/*.h", 11 | "include/spdlog/*/*/*.h", 12 | ]), 13 | defines = [ 14 | "SPDLOG_COMPILED_LIB", 15 | "SPDLOG_FMT_EXTERNAL", 16 | "SPDLOG_DISABLE_DEFAULT_LOGGER", 17 | ], 18 | strip_include_prefix = "include", 19 | deps = ["@com_github_fmtlib_fmt//:fmtlib"], 20 | ) 21 | -------------------------------------------------------------------------------- /third_party/com_github_google_flatbuffers/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_google_flatbuffers/BUILD -------------------------------------------------------------------------------- /third_party/com_github_google_snappy/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_google_snappy/BUILD -------------------------------------------------------------------------------- /third_party/com_github_h2o_picohttpparser/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_h2o_picohttpparser/BUILD -------------------------------------------------------------------------------- /third_party/com_github_h2o_picohttpparser/picohttpparser.BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | default_visibility = ["//visibility:public"], 3 | ) 4 | 5 | cc_library( 6 | name = "picohttpparser", 7 | srcs = ["picohttpparser.c"], 8 | hdrs = ["picohttpparser.h"], 9 | visibility = [ 10 | "//visibility:public", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/com_github_lz4_lz4/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_lz4_lz4/BUILD -------------------------------------------------------------------------------- /third_party/com_github_madler_zlib/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_madler_zlib/BUILD -------------------------------------------------------------------------------- /third_party/com_github_nghttp2_nghttp2/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_nghttp2_nghttp2/BUILD -------------------------------------------------------------------------------- /third_party/com_github_nghttp2_nghttp2/nghttp2.BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "nghttp2", 7 | srcs = glob( 8 | [ 9 | "lib/**/*.c", 10 | ], 11 | exclude = ["lib/**/*_test.c"], 12 | ), 13 | hdrs = glob([ 14 | "lib/includes/**/*.h", 15 | "lib/**/*.h", 16 | ]), 17 | includes = ["lib/includes"], 18 | linkstatic = 1, 19 | ) 20 | -------------------------------------------------------------------------------- /third_party/com_github_tencent_rapidjson/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_tencent_rapidjson/BUILD -------------------------------------------------------------------------------- /third_party/com_github_tencent_rapidjson/rapidjson.BUILD: -------------------------------------------------------------------------------- 1 | # RapidJSON (rapidjson.org) library. 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | ) 6 | 7 | cc_library( 8 | name = "rapidjson", 9 | hdrs = glob(["include/rapidjson/**/*.h"]), 10 | defines = ["RAPIDJSON_HAS_STDSTRING=1"], 11 | includes = ["include"], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/com_github_thalhammer_jwt_cpp/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_thalhammer_jwt_cpp/BUILD -------------------------------------------------------------------------------- /third_party/com_github_thalhammer_jwt_cpp/jwt_cpp.BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | default_visibility = ["//visibility:public"], 3 | ) 4 | 5 | cc_library( 6 | name = "jwt-cpp", 7 | hdrs = glob(["include/jwt-cpp/**/*.h", "include/picojson/*.h"]), 8 | includes = ["include"], 9 | deps = [ 10 | "@com_github_openssl_openssl//:libcrypto", 11 | "@com_github_openssl_openssl//:libssl", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /third_party/com_github_toruniina_toml11/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/com_github_toruniina_toml11/BUILD -------------------------------------------------------------------------------- /third_party/com_github_toruniina_toml11/toml.BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | default_visibility = ["//visibility:public"], 3 | ) 4 | 5 | cc_library( 6 | name = "toml", 7 | hdrs = glob(["**/*.hpp"]), 8 | ) -------------------------------------------------------------------------------- /third_party/zlib/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/third_party/zlib/BUILD -------------------------------------------------------------------------------- /trpc/admin/js/flot_min_js.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | namespace trpc::admin { 17 | 18 | /// @brief Returns a piece of flot-min.js. 19 | /// flot.js, under MIT license, https://github.com/flot/flot/blob/master/LICENSE.txt 20 | /// Version: 0.8.3. 21 | const char* FlotMinJs(); 22 | 23 | } // namespace trpc::admin 24 | -------------------------------------------------------------------------------- /trpc/admin/js/jquery_min_js.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | namespace trpc::admin { 17 | 18 | /// @brief Returns a piece of jquery-min.js. 19 | /// jquery.js, under MIT license, https://github.com/jquery/jquery/blob/main/LICENSE.txt 20 | /// Version: 1.8.3. 21 | const char* JqueryMinJs(); 22 | 23 | } // namespace trpc::admin 24 | -------------------------------------------------------------------------------- /trpc/admin/js/viz_min_js.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | namespace trpc::admin { 17 | 18 | /// @brief Returns a piece of viz-min.js. 19 | /// viz.js, under MIT license, https://github.com/viz-js/viz.js/blob/master/LICENSE 20 | /// Version: 1.8.0 (probably). 21 | const char* VizMinJs(); 22 | 23 | } // namespace trpc::admin 24 | -------------------------------------------------------------------------------- /trpc/admin/perl_tools/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "pprof", 7 | srcs = ["pprof.cc"], 8 | hdrs = ["pprof.h"], 9 | ) 10 | 11 | cc_test( 12 | name = "pprof_test", 13 | srcs = ["pprof_test.cc"], 14 | linkopts = [ 15 | "-ldl", 16 | ], 17 | deps = [ 18 | ":pprof", 19 | "@com_google_googletest//:gtest", 20 | "@com_google_googletest//:gtest_main", 21 | ], 22 | ) 23 | -------------------------------------------------------------------------------- /trpc/admin/perl_tools/pprof.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include 17 | 18 | namespace trpc::admin { 19 | 20 | /// @brief Copy content of perl scripts for performance profiling. 21 | void PprofPerl(std::string *output); 22 | 23 | } // namespace trpc::admin 24 | -------------------------------------------------------------------------------- /trpc/auth/README.md: -------------------------------------------------------------------------------- 1 | Token-based auth plugin. -------------------------------------------------------------------------------- /trpc/auth/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "auth_testing", 7 | hdrs = ["auth_testing.h"], 8 | deps = [ 9 | "//trpc/auth", 10 | "@com_google_googletest//:gtest", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /trpc/client/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/client/README.md -------------------------------------------------------------------------------- /trpc/client/grpc/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_test( 6 | name = "grpc_fiber_test", 7 | srcs = ["grpc_fiber_test.cc"], 8 | data = [ 9 | "//trpc/client/grpc/testing:grpc_fiber.yaml", 10 | ], 11 | deps = [ 12 | "//trpc/client:trpc_client", 13 | "//trpc/client/grpc/testing:grpc_client_call_testing", 14 | "//trpc/server/testing:fiber_server_testing", 15 | "//trpc/server/testing:greeter_service_testing", 16 | "@com_google_googletest//:gtest", 17 | "@com_google_googletest//:gtest_main", 18 | ], 19 | ) -------------------------------------------------------------------------------- /trpc/client/grpc/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | exports_files(["grpc_fiber.yaml"]) 6 | 7 | 8 | cc_library( 9 | name = "grpc_client_call_testing", 10 | srcs = ["grpc_client_call_testing.cc"], 11 | hdrs = ["grpc_client_call_testing.h"], 12 | deps = [ 13 | "//trpc/client:make_client_context", 14 | "//trpc/proto/testing:helloworld_proto", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /trpc/client/trpc_service_proxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/client/rpc_service_proxy.h" 17 | 18 | namespace trpc { 19 | 20 | using TrpcServiceProxy = RpcServiceProxy; 21 | 22 | } // namespace trpc 23 | -------------------------------------------------------------------------------- /trpc/codec/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/codec/README.md -------------------------------------------------------------------------------- /trpc/codec/grpc/http2/testing/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "mock_session", 5 | srcs = [], 6 | hdrs = ["mock_session.h"], 7 | deps = [ 8 | "//trpc/codec/grpc/http2:session", 9 | "@com_google_googletest//:gtest", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /trpc/codec/http/README.md: -------------------------------------------------------------------------------- 1 | HTTP protocol checker. -------------------------------------------------------------------------------- /trpc/codec/non_rpc_protocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/codec/protocol.h" 17 | 18 | namespace trpc { 19 | 20 | using NonRpcProtocol = Protocol; 21 | 22 | } // namespace trpc 23 | -------------------------------------------------------------------------------- /trpc/codec/trpc/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/codec/trpc/README.md -------------------------------------------------------------------------------- /trpc/codec/trpc/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "trpc_protocol_testing", 7 | hdrs = ["trpc_protocol_testing.h"], 8 | deps = [ 9 | "//trpc/codec/trpc:trpc_protocol", 10 | "//trpc/serialization:serialization_factory", 11 | "//trpc/serialization:serialization_type", 12 | "//trpc/util:ref_ptr", 13 | "//trpc/util/buffer", 14 | "//trpc/util/flatbuffers:trpc_fbs", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /trpc/codec/trpc/trpc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "trpc/proto/trpc.proto"; 4 | -------------------------------------------------------------------------------- /trpc/common/async_timer.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | // for compatible 17 | 18 | #include "trpc/future/async_timer.h" 19 | -------------------------------------------------------------------------------- /trpc/common/coroutine/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "task_executor", 7 | hdrs = ["task_executor.h"], 8 | deps = [ 9 | "//trpc/common:status", 10 | ], 11 | ) 12 | 13 | cc_library( 14 | name = "task_executer", 15 | hdrs = ["task_executer.h"], 16 | deps = [ 17 | ":task_executor", 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /trpc/common/coroutine/task_executer.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/common/coroutine/task_executor.h" 17 | 18 | namespace trpc::coroutine { 19 | 20 | // for compatible 21 | template 22 | using TaskExecuter = TaskExecutor; 23 | 24 | } // namespace trpc::coroutine 25 | -------------------------------------------------------------------------------- /trpc/common/coroutine/trpc/trpc_task_executer.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/common/coroutine/trpc/trpc_task_executor.h" 17 | 18 | namespace trpc::coroutine { 19 | 20 | using TrpcTaskExecuter = TrpcTaskExecutor; 21 | 22 | } // namespace trpc::coroutine 23 | -------------------------------------------------------------------------------- /trpc/common/future/README.md: -------------------------------------------------------------------------------- 1 | This module is deprecated, use trpc/future module instead. 2 | -------------------------------------------------------------------------------- /trpc/common/future/basics.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/future/basics.h" 17 | 18 | // This file is for compatibility. 19 | -------------------------------------------------------------------------------- /trpc/common/future/exception.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/future/exception.h" 17 | 18 | // This file is for compatibility. 19 | -------------------------------------------------------------------------------- /trpc/common/future/executor.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/future/executor.h" 17 | 18 | // This file is for compatibility. 19 | -------------------------------------------------------------------------------- /trpc/common/future/function_traits.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/future/function_traits.h" 17 | 18 | // This file is for compatibility. 19 | -------------------------------------------------------------------------------- /trpc/common/future/future.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/future/future.h" 17 | 18 | // This file is for compatibility. 19 | -------------------------------------------------------------------------------- /trpc/common/future/future_utility.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/future/future_utility.h" 17 | 18 | // This file is for compatibility. 19 | -------------------------------------------------------------------------------- /trpc/common/future/reactor_executor.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/future/reactor_executor.h" 17 | 18 | // This file is for compatibility. 19 | -------------------------------------------------------------------------------- /trpc/common/future/types.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/future/types.h" 17 | 18 | // This file is for compatibility. 19 | -------------------------------------------------------------------------------- /trpc/common/logging/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "trpc_logging", 7 | hdrs = ["trpc_logging.h"], 8 | deps = [ 9 | "//trpc/log:trpc_log", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /trpc/common/logging/trpc_logging.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/log/trpc_log.h" 17 | -------------------------------------------------------------------------------- /trpc/common/testing/BUILD: -------------------------------------------------------------------------------- 1 | 2 | licenses(["notice"]) 3 | 4 | package(default_visibility = ["//visibility:public"]) 5 | 6 | exports_files(["fiber_testing.yaml"]) 7 | 8 | exports_files(["merge_testing.yaml"]) 9 | -------------------------------------------------------------------------------- /trpc/common/testing/fiber_testing.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 8 6 | scheduling_group_size: 8 7 | reactor_num_per_scheduling_group: 1 -------------------------------------------------------------------------------- /trpc/common/testing/merge_testing.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: merge 6 | io_thread_num: 4 -------------------------------------------------------------------------------- /trpc/common/trpc_version.cc: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #include "trpc/common/trpc_version.h" 15 | 16 | const char TRPC_Cpp_Version_String[] = TRPC_CPP_VERSION_STRING; 17 | 18 | extern "C" { 19 | const char* TRPC_Cpp_Version() { return TRPC_Cpp_Version_String; } 20 | } 21 | -------------------------------------------------------------------------------- /trpc/compressor/README.md: -------------------------------------------------------------------------------- 1 | Compressor Plugin 2 | 3 | Support: 4 | - gzip 5 | - lz4 6 | - snappy 7 | - zlib 8 | -------------------------------------------------------------------------------- /trpc/compressor/gzip/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "gzip_compressor", 7 | hdrs = ["gzip_compressor.h"], 8 | deps = [ 9 | "//trpc/compressor", 10 | "//trpc/compressor:compressor_type", 11 | "//trpc/compressor/common:zlib_util", 12 | ], 13 | ) 14 | 15 | cc_test( 16 | name = "gzip_compressor_test", 17 | srcs = ["gzip_compressor_test.cc"], 18 | deps = [ 19 | ":gzip_compressor", 20 | "@com_google_googletest//:gtest", 21 | "@com_google_googletest//:gtest_main", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /trpc/compressor/snappy/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "snappy_compressor", 7 | srcs = ["snappy_compressor.cc"], 8 | hdrs = ["snappy_compressor.h"], 9 | deps = [ 10 | "//trpc/compressor", 11 | "//trpc/compressor/common:util", 12 | "@com_github_google_snappy//:snappy", 13 | ], 14 | ) 15 | 16 | cc_test( 17 | name = "snappy_compressor_test", 18 | srcs = ["snappy_compressor_test.cc"], 19 | deps = [ 20 | ":snappy_compressor", 21 | "//trpc/compressor/testing:compressor_testing", 22 | "@com_google_googletest//:gtest", 23 | "@com_google_googletest//:gtest_main", 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /trpc/compressor/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "compressor_testing", 7 | hdrs = [ 8 | "compressor_testing.h", 9 | ], 10 | deps = [ 11 | "//trpc/compressor", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /trpc/compressor/zlib/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "zlib_compressor", 7 | hdrs = ["zlib_compressor.h"], 8 | deps = [ 9 | "//trpc/compressor", 10 | "//trpc/compressor:compressor_type", 11 | "//trpc/compressor/common:zlib_util", 12 | ], 13 | ) 14 | 15 | cc_test( 16 | name = "zlib_compressor_test", 17 | srcs = ["zlib_compressor_test.cc"], 18 | deps = [ 19 | ":zlib_compressor", 20 | "//trpc/compressor/testing:compressor_testing", 21 | "@com_google_googletest//:gtest", 22 | "@com_google_googletest//:gtest_main", 23 | "@zlib", 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /trpc/config/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/config/README.md -------------------------------------------------------------------------------- /trpc/config/codec/common/BUILD: -------------------------------------------------------------------------------- 1 | # Description: trpc-cpp. 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | cc_library( 8 | name = "common_codec", 9 | hdrs = ["common_codec.h"], 10 | ) 11 | -------------------------------------------------------------------------------- /trpc/config/provider/local_file/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/config/provider/local_file/README.md -------------------------------------------------------------------------------- /trpc/config/testing/test.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | config: 3 | local_file: 4 | providers: 5 | - name: file1 6 | filename: trpc/config/testing/test_load.yaml 7 | - name: file2 8 | filename: trpc/config/testing/test_load.json 9 | - name: file3 10 | filename: trpc/config/testing/test_load.toml 11 | -------------------------------------------------------------------------------- /trpc/config/testing/test_load.json: -------------------------------------------------------------------------------- 1 | { 2 | "integer": -42, 3 | "unsigned_integer": 123, 4 | "float": 3.14, 5 | "boolean": true, 6 | "string": "Hello, World!", 7 | "array": [1, 2, 3, 4, 5], 8 | "nested_object": { 9 | "key1": "value1", 10 | "key2": { 11 | "sub_key1": 1, 12 | "sub_key2": false 13 | }, 14 | "key3": [ 15 | { 16 | "name": "Alice", 17 | "age": 30 18 | }, 19 | { 20 | "name": "Bob", 21 | "age": 25 22 | } 23 | ] 24 | }, 25 | "mixed": { 26 | "key1": ["item1", 333], 27 | "key2": ["item2", 444] 28 | }, 29 | "nested_list": [ 30 | ["nested_item1", 111], 31 | ["nested_item2", 222] 32 | ] 33 | } -------------------------------------------------------------------------------- /trpc/config/testing/test_load.toml: -------------------------------------------------------------------------------- 1 | title = "TOML TEST" 2 | 3 | [owner] 4 | name = "John Doe" 5 | dob = "1979-05-27T07:32:00-08:00" # First-class dates 6 | 7 | [database] 8 | server = "127.0.0.1" 9 | ports = [ 8001, 8001, 8002 ] 10 | connection_max = 5000 11 | enabled = true 12 | 13 | [servers] 14 | 15 | # Indentation (tabs and/or spaces) is allowed but not required 16 | [servers.alpha] 17 | ip = "127.0.0.1" 18 | dc = "eqdc10" 19 | 20 | [servers.beta] 21 | ip = "127.0.0.2" 22 | dc = "eqdc10" 23 | -------------------------------------------------------------------------------- /trpc/config/testing/test_load.yaml: -------------------------------------------------------------------------------- 1 | # Simple values 2 | integer: -42 3 | unsigned_integer: 123 4 | float: 3.14 5 | double: 1.23456789 6 | boolean: true 7 | string: "Hello, World!" 8 | 9 | # Complex structures 10 | 11 | # Map 12 | map: 13 | key1: "value1" 14 | key2: 123 15 | nested_map: 16 | nested_key1: "nested_value1" 17 | nested_key2: false 18 | 19 | # List 20 | list: 21 | - "item1" 22 | - 456 23 | - 7.89 24 | - true 25 | 26 | # Nested list 27 | nested_list: 28 | - - "nested_item1" 29 | - 111 30 | - - "nested_item2" 31 | - 222 32 | 33 | # Mixed map and list 34 | mixed: 35 | key1: 36 | - "item1" 37 | - 333 38 | key2: 39 | - "item2" 40 | - 444 -------------------------------------------------------------------------------- /trpc/coroutine/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/coroutine/README.md -------------------------------------------------------------------------------- /trpc/coroutine/fiber/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "runtime", 7 | hdrs = ["runtime.h"], 8 | deps = [ 9 | "//trpc/runtime:fiber_runtime", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /trpc/coroutine/fiber/runtime.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | // for compatible 15 | 16 | #pragma once 17 | 18 | #include "trpc/runtime/fiber_runtime.h" 19 | -------------------------------------------------------------------------------- /trpc/coroutine/fiber_mutex.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | // Flare is licensed under the BSD 3-Clause License. 5 | // The source codes in this file based on 6 | // https://github.com/Tencent/flare/blob/master/flare/fiber/mutex.h. 7 | // This source file may have been modified by THL A29 Limited, and licensed under the BSD 3-Clause License. 8 | // 9 | // 10 | 11 | #pragma once 12 | 13 | #include "trpc/runtime/threadmodel/fiber/detail/waitable.h" 14 | 15 | namespace trpc { 16 | 17 | /// @brief Adaptive mutex primitive for both fiber and pthread context. 18 | using FiberMutex = ::trpc::fiber::detail::Mutex; 19 | 20 | } // namespace trpc 21 | -------------------------------------------------------------------------------- /trpc/filter/filter.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/filter/client_filter_base.h" 17 | #include "trpc/filter/server_filter_base.h" 18 | -------------------------------------------------------------------------------- /trpc/filter/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "client_filter_testing", 7 | hdrs = ["client_filter_testing.h"], 8 | deps = [ 9 | "//trpc/filter:client_filter_base", 10 | "@com_google_googletest//:gtest", 11 | "@com_google_googletest//:gtest_main", 12 | ], 13 | ) 14 | 15 | cc_library( 16 | name = "server_filter_testing", 17 | hdrs = ["server_filter_testing.h"], 18 | deps = [ 19 | "//trpc/filter:server_filter_base", 20 | "@com_google_googletest//:gtest", 21 | "@com_google_googletest//:gtest_main", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /trpc/filter/trpc_filter.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | namespace trpc::filter { 17 | 18 | /// @brief Initialize filter. 19 | /// @note This function is called by framework when initialized. 20 | bool Init(); 21 | 22 | } // namespace trpc::filter 23 | -------------------------------------------------------------------------------- /trpc/log/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/log/README.md -------------------------------------------------------------------------------- /trpc/log/printf_like.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/log/printf_like.h" 17 | -------------------------------------------------------------------------------- /trpc/log/python_like.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/log/python_like.h" 17 | -------------------------------------------------------------------------------- /trpc/log/stream_like.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/log/stream_like.h" 17 | -------------------------------------------------------------------------------- /trpc/log/trpc_log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "trpc/util/log/logging.h" 4 | #include "trpc/util/log/printf_like.h" 5 | #include "trpc/util/log/python_like.h" 6 | #include "trpc/util/log/stream_like.h" 7 | -------------------------------------------------------------------------------- /trpc/metrics/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/metrics/README.md -------------------------------------------------------------------------------- /trpc/metrics/prometheus/testing/prometheus_metrics.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | metrics: 3 | prometheus: 4 | histogram_module_cfg: 5 | - 1 6 | - 2 7 | - 3 8 | const_labels: 9 | key1: value1 10 | key2: value2 11 | -------------------------------------------------------------------------------- /trpc/metrics/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | exports_files(["metrics.yaml"]) 6 | 7 | cc_library( 8 | name = "metrics_testing", 9 | hdrs = ["metrics_testing.h"], 10 | deps = [ 11 | "//trpc/metrics", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /trpc/metrics/testing/metrics.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | metrics: 3 | prometheus: 4 | histogram_module_cfg: 5 | - 1 6 | - 2 7 | - 3 8 | const_labels: 9 | key1: value1 10 | key2: value2 11 | -------------------------------------------------------------------------------- /trpc/naming/common/constants.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | namespace trpc::naming { 17 | 18 | /// Key of instance's metadata 19 | constexpr char kNodeSetName[] = "internal-set-name"; 20 | constexpr char kNodeContainerName[] = "container_name"; 21 | 22 | } // namespace trpc::naming 23 | -------------------------------------------------------------------------------- /trpc/naming/common/util/BUILD: -------------------------------------------------------------------------------- 1 | # Description: trpc-cpp. 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | cc_library( 8 | name = "utils_help", 9 | srcs = ["utils_help.cc"], 10 | hdrs = ["utils_help.h"], 11 | deps = [ 12 | "//trpc/naming/common:common_defs", 13 | "//trpc/util/algorithm:random", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /trpc/naming/common/util/loadbalance/BUILD: -------------------------------------------------------------------------------- 1 | # Description: trpc-cpp. 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | cc_library( 8 | name = "trpc_load_balance", 9 | srcs = ["trpc_load_balance.cc"], 10 | hdrs = ["trpc_load_balance.h"], 11 | deps = [ 12 | "//trpc/naming:load_balance_factory", 13 | "//trpc/naming/common/util/loadbalance/hash:consistenthash_load_balance", 14 | "//trpc/naming/common/util/loadbalance/hash:modulohash_load_balance", 15 | "//trpc/naming/common/util/loadbalance/polling:polling_load_balance", 16 | "//trpc/naming/common/util/loadbalance/weighted_round_robin:weighted_round_robin_load_balancer", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /trpc/naming/common/util/loadbalance/polling/BUILD: -------------------------------------------------------------------------------- 1 | # Description: trpc-cpp. 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | cc_library( 8 | name = "polling_load_balance", 9 | srcs = ["polling_load_balance.cc"], 10 | hdrs = ["polling_load_balance.h"], 11 | visibility = [ 12 | "//visibility:public", 13 | ], 14 | deps = [ 15 | "//trpc/naming:load_balance_factory", 16 | "//trpc/util/log:logging", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /trpc/naming/direct/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/naming/direct/README.md -------------------------------------------------------------------------------- /trpc/naming/domain/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/naming/domain/README.md -------------------------------------------------------------------------------- /trpc/naming/testing/domain_test.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | selector: 3 | domain: 4 | exclude_ipv6: true 5 | -------------------------------------------------------------------------------- /trpc/overload_control/common/report_test.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | namespace: informal 3 | env_name: test1 4 | container_name: test_container1 5 | local_ip: 0.0.0.0 6 | coroutine: 7 | enable: false 8 | 9 | plugins: 10 | metrics: 11 | test_metrics: {} 12 | -------------------------------------------------------------------------------- /trpc/overload_control/server_overload_controller_factory.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, Tencent Inc. 2 | // All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include "trpc/overload_control/common/overload_control_factory.h" 10 | #include "trpc/overload_control/server_overload_controller.h" 11 | 12 | namespace trpc::overload_control { 13 | 14 | using ServerOverloadControllerFactory = OverloadControlFactory; 15 | 16 | } // namespace trpc::overload_control 17 | -------------------------------------------------------------------------------- /trpc/overload_control/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "overload_control_testing", 7 | hdrs = ["overload_control_testing.h"], 8 | visibility = ["//visibility:public"], 9 | deps = [ 10 | "//trpc/codec:protocol", 11 | "//trpc/coroutine:fiber", 12 | "//trpc/coroutine/testing:fiber_runtime_test", 13 | "//trpc/filter:filter_manager", 14 | "//trpc/overload_control:server_overload_controller", 15 | "//trpc/server:service", 16 | "//trpc/server/testing:service_adapter_testing", 17 | "@com_google_googletest//:gtest_main", 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /trpc/overload_control/trpc_overload_control.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, Tencent Inc. 2 | // All rights reserved. 3 | 4 | #include "trpc/overload_control/trpc_overload_control.h" 5 | 6 | #include "trpc/overload_control/server_overload_controller_factory.h" 7 | 8 | namespace trpc::overload_control { 9 | 10 | bool Init() { 11 | // Register plugins here 12 | return true; 13 | } 14 | 15 | void Stop() { 16 | // Stop plugins here 17 | ServerOverloadControllerFactory::GetInstance()->Stop(); 18 | } 19 | 20 | void Destroy() { 21 | // Destroy plugins here 22 | ServerOverloadControllerFactory::GetInstance()->Destroy(); 23 | } 24 | 25 | } // namespace trpc::overload_control 26 | -------------------------------------------------------------------------------- /trpc/overload_control/trpc_overload_control.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, Tencent Inc. 2 | // All rights reserved. 3 | 4 | #pragma once 5 | 6 | namespace trpc::overload_control { 7 | 8 | /// @brief Intialize overload plugins 9 | bool Init(); 10 | 11 | /// @brief Stop inner started thread(maybe) of overload plugins 12 | void Stop(); 13 | 14 | /// @brief Destroy resource of overload plugins 15 | void Destroy(); 16 | 17 | } // namespace trpc::overload_control 18 | -------------------------------------------------------------------------------- /trpc/proto/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package( 4 | default_visibility = [ 5 | "//trpc:__subpackages__", 6 | "//test:__subpackages__", 7 | ] 8 | ) 9 | 10 | proto_library( 11 | name = "trpc_proto", 12 | srcs = ["trpc.proto"], 13 | deps = [ 14 | "@com_github_trpc_protocol//trpc:trpc_proto", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /trpc/proto/testing/helloworld.fbs: -------------------------------------------------------------------------------- 1 | namespace trpc.test.helloworld; 2 | 3 | table FbReply { 4 | message:string; 5 | } 6 | 7 | table FbRequest { 8 | message:string; 9 | } 10 | 11 | rpc_service FbGreeter { 12 | SayHello(FbRequest):FbReply; 13 | } 14 | -------------------------------------------------------------------------------- /trpc/proto/testing/helloworld.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.helloworld; 4 | 5 | service Greeter { 6 | rpc SayHello (HelloRequest) returns (HelloReply) {} 7 | } 8 | 9 | message HelloRequest { 10 | string msg = 1; 11 | } 12 | 13 | message HelloReply { 14 | string msg = 1; 15 | } 16 | -------------------------------------------------------------------------------- /trpc/proto/trpc.proto: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making tRPC available. 2 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. 3 | // If you have downloaded a copy of the tRPC source code from Tencent, 4 | // please note that tRPC source code is licensed under the Apache 2.0 License, 5 | // A copy of the Apache 2.0 License is included in this file. 6 | 7 | syntax = "proto3"; 8 | 9 | import "trpc/trpc.proto"; 10 | -------------------------------------------------------------------------------- /trpc/rpcz/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | exports_files(["rpcz.yaml"]) 6 | -------------------------------------------------------------------------------- /trpc/runtime/common/runtime_info_report/test.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 0.0.0.0 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: separate 7 | io_thread_num: 4 8 | handle_thread_num: 4 9 | enable_runtime_report: true 10 | report_runtime_info_interval: 30000 11 | plugins: 12 | metrics: 13 | test_runtime_report: -------------------------------------------------------------------------------- /trpc/runtime/common/stats/server_stats.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | threadmodel: 4 | default: 5 | - instance_name: default_instance 6 | io_handle_type: merge 7 | io_thread_num: 1 8 | 9 | server: 10 | app: test 11 | server: test_server 12 | bin_path: ./ 13 | conf_path: ./ 14 | data_path: ./ 15 | server_stats_interval: 1000 16 | service: 17 | plugins: 18 | metrics: 19 | test_server_stats: 20 | param1: 10000 21 | -------------------------------------------------------------------------------- /trpc/runtime/init_runtime.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | // for compatible 17 | #include "trpc/runtime/runtime.h" 18 | -------------------------------------------------------------------------------- /trpc/runtime/iomodel/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | -------------------------------------------------------------------------------- /trpc/runtime/iomodel/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/runtime/iomodel/README.md -------------------------------------------------------------------------------- /trpc/runtime/iomodel/reactor/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "event_handler", 7 | srcs = ["event_handler.cc"], 8 | hdrs = ["event_handler.h"], 9 | deps = [ 10 | "//trpc/util:ref_ptr", 11 | ], 12 | ) 13 | 14 | cc_library( 15 | name = "poller", 16 | hdrs = ["poller.h"], 17 | deps = [ 18 | ":event_handler", 19 | "//trpc/util:function", 20 | ], 21 | ) 22 | 23 | cc_library( 24 | name = "reactor", 25 | hdrs = ["reactor.h"], 26 | deps = [ 27 | ":event_handler", 28 | "//trpc/runtime/threadmodel/common:timer_task", 29 | "//trpc/util:function", 30 | ], 31 | ) 32 | -------------------------------------------------------------------------------- /trpc/runtime/iomodel/reactor/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "mock_connection_testing", 7 | hdrs = ["mock_connection_testing.h"], 8 | deps = [ 9 | "//trpc/runtime/iomodel/reactor/common:connection", 10 | "@com_google_googletest//:gtest", 11 | "@com_google_googletest//:gtest_main", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /trpc/runtime/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | exports_files(["heartbeat_report_test.yaml"]) -------------------------------------------------------------------------------- /trpc/runtime/threadmodel/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "thread_model", 7 | hdrs = ["thread_model.h"], 8 | deps = [ 9 | "//trpc/runtime/threadmodel/common:msg_task", 10 | ], 11 | ) 12 | 13 | cc_library( 14 | name = "thread_model_manager", 15 | srcs = ["thread_model_manager.cc"], 16 | hdrs = ["thread_model_manager.h"], 17 | deps = [ 18 | ":thread_model", 19 | "//trpc/util/log:logging", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /trpc/runtime/threadmodel/fiber/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/runtime/threadmodel/fiber/README.md -------------------------------------------------------------------------------- /trpc/runtime/threadmodel/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | exports_files(["separate.yaml"]) 6 | 7 | exports_files(["fiber.yaml"]) 8 | 9 | exports_files(["merge.yaml"]) 10 | 11 | cc_library( 12 | name = "thread_model_testing", 13 | hdrs = ["thread_model_testing.h"], 14 | deps = [ 15 | "//trpc/runtime/threadmodel:thread_model", 16 | "@com_google_googletest//:gtest", 17 | "@com_google_googletest//:gtest_main", 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /trpc/runtime/threadmodel/testing/fiber.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | fiber: 4 | - instance_name: fiber_instance 5 | concurrency_hint: 8 6 | scheduling_group_size: 8 7 | reactor_num_per_scheduling_group: 2 8 | -------------------------------------------------------------------------------- /trpc/runtime/threadmodel/testing/merge.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: merge 6 | io_thread_num: 8 7 | -------------------------------------------------------------------------------- /trpc/runtime/threadmodel/testing/separate.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_instance 5 | io_handle_type: separate 6 | io_thread_num: 8 7 | handle_thread_num: 2 8 | handle_thread_task_queue_size: 10240 9 | scheduling: 10 | scheduling_name: non_fiber 11 | local_queue_size: 10240 12 | max_timer_size: 20480 13 | -------------------------------------------------------------------------------- /trpc/serialization/README.md: -------------------------------------------------------------------------------- 1 | Serialization Plugin 2 | 3 | Support: 4 | - pb 5 | - json 6 | - flatbuffers 7 | - binary/text -------------------------------------------------------------------------------- /trpc/serialization/noop/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "noop_serialization", 7 | srcs = ["noop_serialization.cc"], 8 | hdrs = ["noop_serialization.h"], 9 | deps = [ 10 | "//trpc/serialization", 11 | "//trpc/util/buffer:zero_copy_stream", 12 | "//trpc/util/log:logging", 13 | ], 14 | ) 15 | 16 | cc_test( 17 | name = "noop_serialization_test", 18 | srcs = ["noop_serialization_test.cc"], 19 | deps = [ 20 | ":noop_serialization", 21 | "@com_google_googletest//:gtest", 22 | "@com_google_googletest//:gtest_main", 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /trpc/serialization/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | load("@rules_cc//cc:defs.bzl", "cc_proto_library") 6 | load("@rules_proto//proto:defs.bzl", "proto_library") 7 | 8 | cc_proto_library( 9 | name = "test_serialization_cc_proto", 10 | deps = [":test_serialization_proto"], 11 | ) 12 | 13 | proto_library( 14 | name = "test_serialization_proto", 15 | srcs = ["test_serialization.proto"], 16 | ) 17 | -------------------------------------------------------------------------------- /trpc/serialization/testing/test_serialization.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.serialization; 4 | 5 | message HelloRequest { 6 | string msg = 1; 7 | } 8 | 9 | message HelloReply { 10 | string msg = 1; 11 | } 12 | -------------------------------------------------------------------------------- /trpc/server/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/server/README.md -------------------------------------------------------------------------------- /trpc/server/non_rpc_method_handler.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/non_rpc/non_rpc_method_handler.h" 17 | -------------------------------------------------------------------------------- /trpc/server/non_rpc_service_impl.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/non_rpc/non_rpc_service_impl.h" 17 | -------------------------------------------------------------------------------- /trpc/server/non_rpc_service_method.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/non_rpc/non_rpc_service_method.h" 17 | -------------------------------------------------------------------------------- /trpc/server/rpc_async_method_handler.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/async_rpc/async_rpc_method_handler.h" 17 | -------------------------------------------------------------------------------- /trpc/server/rpc_method_handler.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/rpc/rpc_method_handler.h" 17 | -------------------------------------------------------------------------------- /trpc/server/rpc_service_impl.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/rpc/rpc_service_impl.h" 17 | #include "trpc/server/async_rpc/async_rpc_service_impl.h" 18 | -------------------------------------------------------------------------------- /trpc/server/rpc_service_method.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/rpc/rpc_service_method.h" 17 | -------------------------------------------------------------------------------- /trpc/server/stream_rpc_async_method_handler.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/async_rpc/async_stream_rpc_method_handler.h" 17 | -------------------------------------------------------------------------------- /trpc/server/stream_rpc_method_handler.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/server/rpc/stream_rpc_method_handler.h" 17 | -------------------------------------------------------------------------------- /trpc/stream/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/stream/README.md -------------------------------------------------------------------------------- /trpc/stream/http/async/server/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "mock_server_async_stream", 7 | srcs = [], 8 | hdrs = ["mock_server_async_stream.h"], 9 | deps = [ 10 | "//trpc/stream/http/async/server:stream", 11 | "@com_google_googletest//:gtest", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /trpc/stream/http/async/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "mock_async_stream", 7 | srcs = [], 8 | hdrs = ["mock_async_stream.h"], 9 | deps = [ 10 | "//trpc/stream/http/async:stream", 11 | "@com_google_googletest//:gtest", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /trpc/stream/http/common/client/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "stream_handler", 7 | srcs = ["stream_handler.cc"], 8 | hdrs = ["stream_handler.h"], 9 | deps = [ 10 | "//trpc/stream/http/common:stream_handler", 11 | ], 12 | ) 13 | 14 | cc_test( 15 | name = "stream_handler_test", 16 | srcs = ["stream_handler_test.cc"], 17 | deps = [ 18 | ":stream_handler", 19 | "@com_google_googletest//:gtest_main", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /trpc/stream/http/common/server/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "stream_handler", 5 | srcs = ["stream_handler.cc"], 6 | hdrs = ["stream_handler.h"], 7 | deps = [ 8 | "//trpc/codec:server_codec_factory", 9 | "//trpc/stream/http/common:stream_handler", 10 | ], 11 | ) 12 | 13 | cc_test( 14 | name = "stream_handler_test", 15 | srcs = ["stream_handler_test.cc"], 16 | deps = [ 17 | ":stream_handler", 18 | "//trpc/codec:codec_manager", 19 | "@com_google_googletest//:gtest_main", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /trpc/stream/http/common/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "mock_stream", 7 | srcs = [], 8 | hdrs = ["mock_stream.h"], 9 | deps = [ 10 | "//trpc/stream/http/common:stream", 11 | "//trpc/stream/http/common:stream_handler", 12 | "@com_google_googletest//:gtest", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /trpc/stream/stream_handler_manager.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | namespace trpc::stream { 17 | 18 | /// @brief Initializes the stream handler. 19 | bool InitStreamHandler(); 20 | 21 | /// @brief Destroys the stream handler. 22 | void DestroyStreamHandler(); 23 | 24 | } // namespace trpc::stream 25 | -------------------------------------------------------------------------------- /trpc/stream/testing/stream.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test.helloworld; 4 | 5 | service Greeter { 6 | // Unary 7 | rpc SayHello (HelloRequest) returns (HelloReply) {} 8 | 9 | // Client streaming 10 | rpc ClientStreamSayHello (stream HelloRequest) returns (HelloReply) {} 11 | 12 | // Server streaming 13 | rpc ServerStreamSayHello (HelloRequest) returns (stream HelloReply) {} 14 | 15 | // Bidi streaming 16 | rpc BidiStreamSayHello (stream HelloRequest) returns (stream HelloReply) {} 17 | } 18 | 19 | message HelloRequest { 20 | string msg = 1; 21 | } 22 | 23 | message HelloReply { 24 | string msg = 1; 25 | } 26 | -------------------------------------------------------------------------------- /trpc/stream/trpc/testing/BUILD: -------------------------------------------------------------------------------- 1 | # Description: trpc-cpp. 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "trpc_stream_testing", 7 | srcs = [], 8 | hdrs = ["trpc_stream_testing.h"], 9 | deps = [ 10 | "//trpc/codec/trpc:trpc_protocol", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /trpc/tools/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/tools/README.md -------------------------------------------------------------------------------- /trpc/tools/comm/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "utils", 7 | srcs = ["utils.cc"], 8 | hdrs = ["utils.h"], 9 | deps = [ 10 | "@com_google_protobuf//:protobuf", 11 | "@com_google_protobuf//:protoc_lib", 12 | ], 13 | ) 14 | 15 | proto_library( 16 | name = "trpc_cpp_options_proto", 17 | srcs = ["trpc_cpp_options.proto"], 18 | deps = ["@com_google_protobuf//:descriptor_proto"], 19 | ) 20 | -------------------------------------------------------------------------------- /trpc/tools/comm/trpc_cpp_options.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc; 4 | 5 | import "google/protobuf/descriptor.proto"; 6 | 7 | extend google.protobuf.MethodOptions { 8 | CppExt cpp_ext = 82001; 9 | } 10 | 11 | message CppExt { 12 | repeated string alias = 1; // support mutiple alias 13 | } -------------------------------------------------------------------------------- /trpc/tools/flatbuffers_tool/testing/greeter.fbs: -------------------------------------------------------------------------------- 1 | namespace trpc.test.helloworld; 2 | 3 | table HelloReply { 4 | message:string; 5 | } 6 | 7 | table HelloRequest { 8 | name:string; 9 | } 10 | 11 | table ManyHellosRequest { 12 | name:string; 13 | num_greetings:int; 14 | } 15 | 16 | rpc_service Greeter { 17 | SayHello(HelloRequest):HelloReply; 18 | SayManyHellos(ManyHellosRequest):HelloReply; 19 | } 20 | -------------------------------------------------------------------------------- /trpc/tracing/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/tracing/README.md -------------------------------------------------------------------------------- /trpc/transport/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/transport/README.md -------------------------------------------------------------------------------- /trpc/transport/client/future/README.md: -------------------------------------------------------------------------------- 1 | This directory contains implementation of future transport. 2 | # Design 3 | - Every client service has its own FutureTransport instance. 4 | - Every reactor of thread model instance has its own FutureTransportAdaptor, in order to avoid cache bouncing. 5 | - FutureConnectorGroup is used to manage all the connections current client service reactor to a backend host. 6 | - Timing wheel is used to improve performance of request timeout. 7 | 8 | # Category 9 | - connection complex 10 | - connection pool 11 | - pipeline 12 | -------------------------------------------------------------------------------- /trpc/transport/client/future/testing/merge_separate_threadmodel.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | threadmodel: 3 | default: 4 | - instance_name: default_separate 5 | io_handle_type: separate 6 | io_thread_num: 1 7 | handle_thread_num: 1 8 | - instance_name: default_merge 9 | io_handle_type: merge 10 | io_thread_num: 1 -------------------------------------------------------------------------------- /trpc/transport/client/preallocation_option.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/transport/common/transport_message_common.h" 17 | 18 | namespace trpc { 19 | 20 | /// @brief Pre-allocate connection option 21 | struct PreallocationOption { 22 | NodeAddr node_addr; 23 | }; 24 | 25 | } // namespace trpc 26 | -------------------------------------------------------------------------------- /trpc/transport/common/io_handler_manager.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | namespace trpc { 17 | 18 | /// @brief Initilize io handlers which used by framework 19 | bool InitIoHandler(); 20 | 21 | /// @brief Destroy all registered io handlers 22 | void DestroyIoHandler(); 23 | 24 | } // namespace trpc 25 | -------------------------------------------------------------------------------- /trpc/transport/common/ssl/cert/README.md: -------------------------------------------------------------------------------- 1 | `cert` directory was used for unit testing only, it contains `Self-Sigined CA Key` and `Server Key`, 2 | they were used by unit test case. 3 | 4 | !!! Note: Don't used them in production environment. -------------------------------------------------------------------------------- /trpc/transport/common/ssl/cert/ca/xxops-com-chain/mk_ca_root_key.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | KEY_NAME='root-ca.key' 4 | CERT_NAME='root-ca.crt' 5 | 6 | ## generate rsa key 7 | openssl genrsa -out ${KEY_NAME} 2048 8 | 9 | ## create self-signed the root certificate 10 | openssl req -x509 -new -nodes -key ${KEY_NAME} -sha256 -days 1095 -subj "/C=CN/ST=CA/O=xxops digit cert org" -out ${CERT_NAME} 11 | 12 | 13 | -------------------------------------------------------------------------------- /trpc/transport/common/ssl/cert/ca/xxops-com-chain/mk_xxops_com_dhparam.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | DHPARAM_NAME='xxopsop-com.dhparam' 4 | 5 | openssl dhparam 2048 -check -out ${DHPARAM_NAME} -------------------------------------------------------------------------------- /trpc/transport/common/ssl/cert/ca/xxops-com-chain/root-ca.srl: -------------------------------------------------------------------------------- 1 | A65262790647EC1B 2 | -------------------------------------------------------------------------------- /trpc/transport/common/ssl/cert/ca/xxops-com-chain/xxops-com.dhparam: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEAnMcSkTzUn1MrECQqZWO4/PsOlpmScZ0zGtKueDanUtSNZfVymkqi 3 | 5SdLefAocDpvbdP5caGpAGrVRxAk3M6Qw4fl05cCoJNAHBRDiDpRq6Py1HbNJ6D0 4 | QZUtZMt3ZaGGTKIo5uk5EoPaxxyJG/2TvEgkn25TEJyuP8qE82Ou5s/Gv7Z4kC9i 5 | yyKZXVbYc/YKkpz5u0pAnVwjYLMbHZ+W/hTI6zqv7UF3YM4Kpc9Z86HOZxxPwLqA 6 | /NBNlMj9GgwODKiiK+pYSY58JO6ApGmwVrry6Mi9tCKHWH/3iHdaypcA5SaGhDHL 7 | 5JSkeSQhsDh1aLaSZP4bwjCo8S+uyJyEmwIBAg== 8 | -----END DH PARAMETERS----- 9 | -------------------------------------------------------------------------------- /trpc/transport/common/ssl/cert/server_dhparam.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEAnMcSkTzUn1MrECQqZWO4/PsOlpmScZ0zGtKueDanUtSNZfVymkqi 3 | 5SdLefAocDpvbdP5caGpAGrVRxAk3M6Qw4fl05cCoJNAHBRDiDpRq6Py1HbNJ6D0 4 | QZUtZMt3ZaGGTKIo5uk5EoPaxxyJG/2TvEgkn25TEJyuP8qE82Ou5s/Gv7Z4kC9i 5 | yyKZXVbYc/YKkpz5u0pAnVwjYLMbHZ+W/hTI6zqv7UF3YM4Kpc9Z86HOZxxPwLqA 6 | /NBNlMj9GgwODKiiK+pYSY58JO6ApGmwVrry6Mi9tCKHWH/3iHdaypcA5SaGhDHL 7 | 5JSkeSQhsDh1aLaSZP4bwjCo8S+uyJyEmwIBAg== 8 | -----END DH PARAMETERS----- 9 | -------------------------------------------------------------------------------- /trpc/transport/common/ssl/cert/xxops-com.dhparam: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEAnMcSkTzUn1MrECQqZWO4/PsOlpmScZ0zGtKueDanUtSNZfVymkqi 3 | 5SdLefAocDpvbdP5caGpAGrVRxAk3M6Qw4fl05cCoJNAHBRDiDpRq6Py1HbNJ6D0 4 | QZUtZMt3ZaGGTKIo5uk5EoPaxxyJG/2TvEgkn25TEJyuP8qE82Ou5s/Gv7Z4kC9i 5 | yyKZXVbYc/YKkpz5u0pAnVwjYLMbHZ+W/hTI6zqv7UF3YM4Kpc9Z86HOZxxPwLqA 6 | /NBNlMj9GgwODKiiK+pYSY58JO6ApGmwVrry6Mi9tCKHWH/3iHdaypcA5SaGhDHL 7 | 5JSkeSQhsDh1aLaSZP4bwjCo8S+uyJyEmwIBAg== 8 | -----END DH PARAMETERS----- 9 | -------------------------------------------------------------------------------- /trpc/transport/common/transport_message.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/transport/server/server_transport_message.h" 17 | -------------------------------------------------------------------------------- /trpc/transport/server/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "server_transport_testing", 7 | hdrs = ["server_transport_testing.h"], 8 | deps = [ 9 | "//trpc/transport/server:server_transport", 10 | "@com_google_googletest//:gtest", 11 | "@com_google_googletest//:gtest_main", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /trpc/tvar/BUILD: -------------------------------------------------------------------------------- 1 | # Description: trpc-cpp. 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | cc_library( 8 | name = "tvar", 9 | hdrs = ["tvar.h"], 10 | visibility = [ 11 | "//visibility:public", 12 | ], 13 | deps = [ 14 | "//trpc/tvar/basic_ops:passive_status", 15 | "//trpc/tvar/basic_ops:recorder", 16 | "//trpc/tvar/basic_ops:reducer", 17 | "//trpc/tvar/basic_ops:status", 18 | "//trpc/tvar/common:tvar_group", 19 | "//trpc/tvar/compound_ops:latency_recorder", 20 | "//trpc/tvar/compound_ops:window", 21 | ], 22 | ) 23 | -------------------------------------------------------------------------------- /trpc/tvar/README.md: -------------------------------------------------------------------------------- 1 | This directory contains implementation of tvar. 2 | # Design 3 | - Aimed at write mostly scenario, thread local mechanism is used to imporve write performance, which leadings to poor read performance. 4 | 5 | # Category 6 | - Counter 7 | - Gauge 8 | - Maxer 9 | - Miner 10 | - Averager 11 | - IntRecorder 12 | - Status 13 | - PassiveStatus 14 | - Window 15 | - PerSecond 16 | - LatencyRecorder 17 | -------------------------------------------------------------------------------- /trpc/tvar/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | exports_files(["noseries.yaml"]) 6 | 7 | exports_files(["series.yaml"]) 8 | -------------------------------------------------------------------------------- /trpc/tvar/testing/noseries.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | tvar: 4 | window_size: 20 5 | save_series: false 6 | latency_p1: 85 7 | latency_p2: 95 8 | latency_p3: 99 9 | 10 | server: 11 | app: test 12 | server: test_server 13 | bin_path: ./ 14 | conf_path: ./ 15 | data_path: ./ 16 | server_stats_interval: 1000 17 | service: 18 | -------------------------------------------------------------------------------- /trpc/tvar/testing/series.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | local_ip: 127.0.0.1 3 | tvar: 4 | window_size: 20 5 | save_series: true 6 | latency_p1: 85 7 | latency_p2: 95 8 | latency_p3: 99 9 | 10 | server: 11 | app: test 12 | server: test_server 13 | bin_path: ./ 14 | conf_path: ./ 15 | data_path: ./ 16 | server_stats_interval: 1000 17 | service: 18 | -------------------------------------------------------------------------------- /trpc/util/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/util/README.md -------------------------------------------------------------------------------- /trpc/util/async_io/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "async_io", 7 | hdrs = ["async_io.h"], 8 | deps = [ 9 | "//trpc/runtime/iomodel/async_io", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /trpc/util/async_io/async_io.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | // for compatiblie 17 | #include "trpc/runtime/iomodel/async_io/async_io.h" 18 | -------------------------------------------------------------------------------- /trpc/util/buffer/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | proto_library( 6 | name = "message_proto", 7 | srcs = [ 8 | "message.proto", 9 | ], 10 | ) 11 | 12 | cc_proto_library( 13 | name = "cc_message_proto", 14 | deps = [ 15 | ":message_proto", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /trpc/util/concurrency/BUILD: -------------------------------------------------------------------------------- 1 | # Description: trpc-cpp. 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | cc_library( 8 | name = "lightly_concurrent_hashmap", 9 | hdrs = ["lightly_concurrent_hashmap.h"], 10 | deps = [ 11 | "//trpc/util/concurrency/detail:lightly_concurrent_hashmap_impl", 12 | ], 13 | ) -------------------------------------------------------------------------------- /trpc/util/concurrency/detail/BUILD: -------------------------------------------------------------------------------- 1 | # Description: trpc-cpp. 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | cc_library( 8 | name = "lightly_concurrent_hashmap_impl", 9 | hdrs = ["lightly_concurrent_hashmap_impl.h"], 10 | deps = [ 11 | "//trpc/util/hazptr", 12 | ], 13 | ) 14 | 15 | cc_test( 16 | name = "lightly_concurrent_hashmap_impl_test", 17 | srcs = ["lightly_concurrent_hashmap_impl_test.cc"], 18 | deps = [ 19 | ":lightly_concurrent_hashmap_impl", 20 | "@com_google_googletest//:gtest", 21 | "@com_google_googletest//:gtest_main", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /trpc/util/doubly_linked_list.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/internal/doubly_linked_list.h" 17 | -------------------------------------------------------------------------------- /trpc/util/hash_util.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/algorithm/hash.h" 17 | -------------------------------------------------------------------------------- /trpc/util/hazptr/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "hazptr", 7 | srcs = [ 8 | "entry_cache.cc", 9 | "hazptr_domain.cc", 10 | "hazptr_object.cc", 11 | ], 12 | hdrs = [ 13 | "entry.h", 14 | "entry_cache.h", 15 | "hazptr.h", 16 | "hazptr_domain.h", 17 | "hazptr_object.h", 18 | ], 19 | deps = [ 20 | "//trpc/util/internal:never_destroyed", 21 | "//trpc/util/internal:time_keeper", 22 | "//trpc/util/thread/internal:memory_barrier", 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /trpc/util/http/body_params.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | // Just for the sake of backward compatibility. 17 | #include "trpc/util/http/parameter.h" 18 | -------------------------------------------------------------------------------- /trpc/util/http/http_header.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/http/header.h" 17 | 18 | namespace trpc::http { 19 | 20 | using HttpHeader = HeaderPairs; 21 | 22 | } // namespace trpc::http 23 | -------------------------------------------------------------------------------- /trpc/util/http/reply.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/http/response.h" 17 | -------------------------------------------------------------------------------- /trpc/util/internal/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/util/internal/README.md -------------------------------------------------------------------------------- /trpc/util/latch.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | /// @brief Just for backward compatibility 17 | #include "trpc/util/thread/latch.h" 18 | -------------------------------------------------------------------------------- /trpc/util/likely.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #if __GNUC__ 17 | #define TRPC_LIKELY(expr) (__builtin_expect(!!(expr), 1)) 18 | #define TRPC_UNLIKELY(expr) (__builtin_expect(!!(expr), 0)) 19 | #else 20 | #define TRPC_LIKELY(expr) (expr) 21 | #define TRPC_UNLIKELY(expr) (expr) 22 | #endif 23 | -------------------------------------------------------------------------------- /trpc/util/lockfree_queue.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/queue/lockfree_queue.h" 17 | -------------------------------------------------------------------------------- /trpc/util/log/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/util/log/README.md -------------------------------------------------------------------------------- /trpc/util/log/default/sinks/stdout/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "stdout_sink", 7 | hdrs = ["stdout_sink.h"], 8 | deps = [ 9 | "//trpc/common/config:default_log_conf", 10 | "//trpc/common/config:stdout_sink_conf", 11 | "//trpc/util:ref_ptr", 12 | "@com_github_gabime_spdlog//:spdlog", 13 | ], 14 | ) 15 | 16 | cc_test( 17 | name = "stdout_sink_test", 18 | srcs = ["stdout_sink_test.cc"], 19 | deps = [ 20 | ":stdout_sink", 21 | "@com_google_googletest//:gtest", 22 | "@com_google_googletest//:gtest_main", 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /trpc/util/log/default/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | exports_files([ 6 | "default_log_test.yaml", 7 | ]) 8 | 9 | cc_library( 10 | name = "mock_sink", 11 | hdrs = ["mock_sink.h"], 12 | deps = [ 13 | "//trpc/util:ref_ptr", 14 | "@com_github_gabime_spdlog//:spdlog", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /trpc/util/log/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | exports_files([ 6 | "trpc_log_test.yaml", 7 | ]) 8 | 9 | cc_library( 10 | name = "mock_log", 11 | hdrs = [ 12 | "mock_log.h", 13 | ], 14 | deps = [ 15 | "//trpc/util/log", 16 | "//trpc/util/log/default:default_log", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /trpc/util/object_pool/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trpc-group/trpc-cpp/9f63b6c7646584aa26f30db134e7559524cbc47d/trpc/util/object_pool/README.md -------------------------------------------------------------------------------- /trpc/util/queue/detail/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | ) 6 | 7 | cc_library( 8 | name = "util", 9 | hdrs = ["util.h"], 10 | ) 11 | -------------------------------------------------------------------------------- /trpc/util/random.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | /// @brief Just for backward compatibility 17 | #include "trpc/util/algorithm/random.h" 18 | -------------------------------------------------------------------------------- /trpc/util/string_helper.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | /// @brief Just for backward compatibility 17 | #include "trpc/util/string/string_helper.h" 18 | -------------------------------------------------------------------------------- /trpc/util/string_util.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | /// @brief Just for backward compatibility 17 | #include "trpc/util/string/string_util.h" 18 | -------------------------------------------------------------------------------- /trpc/util/testing/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | load("@rules_cc//cc:defs.bzl", "cc_proto_library") 6 | load("@rules_proto//proto:defs.bzl", "proto_library") 7 | 8 | cc_proto_library( 9 | name = "testjson_cc_proto", 10 | deps = [":testjson_proto"], 11 | ) 12 | 13 | proto_library( 14 | name = "testjson_proto", 15 | srcs = ["testjson.proto"], 16 | ) 17 | -------------------------------------------------------------------------------- /trpc/util/testing/testjson.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package trpc.test; 4 | 5 | message TestMessage { 6 | string msg = 1; 7 | } 8 | -------------------------------------------------------------------------------- /trpc/util/thread/bounded_mpmc_queue.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/queue/bounded_mpmc_queue.h" 17 | -------------------------------------------------------------------------------- /trpc/util/thread/bounded_mpsc_queue.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/queue/bounded_mpsc_queue.h" 17 | -------------------------------------------------------------------------------- /trpc/util/thread/internal/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "memory_barrier", 7 | srcs = ["memory_barrier.cc"], 8 | hdrs = ["memory_barrier.h"], 9 | deps = [ 10 | "//trpc/util:check", 11 | "//trpc/util/internal:never_destroyed", 12 | "//trpc/util/log:logging", 13 | ], 14 | ) 15 | 16 | cc_library( 17 | name = "object_array", 18 | hdrs = ["object_array.h"], 19 | deps = [ 20 | "//trpc/util:align", 21 | "//trpc/util:function", 22 | "//trpc/util:likely", 23 | "//trpc/util/internal:never_destroyed", 24 | "//trpc/util/log:logging", 25 | ], 26 | ) 27 | -------------------------------------------------------------------------------- /trpc/util/thread/memory_barrier.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/thread/internal/memory_barrier.h" 17 | 18 | namespace trpc { 19 | 20 | /// @brief For details, please refer to `internal::MemoryBarrier` 21 | inline void MemoryBarrier() { internal::MemoryBarrier(); } 22 | 23 | } // namespace trpc 24 | -------------------------------------------------------------------------------- /trpc/util/thread/thread_pool_option.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | namespace trpc { 17 | 18 | /// @brief Thread pool initialization parameters 19 | struct ThreadPoolOption { 20 | std::size_t thread_num = 1; 21 | std::size_t task_queue_size = 10000; 22 | bool bind_core = false; 23 | }; 24 | 25 | } // namespace trpc 26 | -------------------------------------------------------------------------------- /trpc/util/thread/unbounded_spmc_queue.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Tencent is pleased to support the open source community by making tRPC available. 4 | // 5 | // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 | // All rights reserved. 7 | // 8 | // If you have downloaded a copy of the tRPC source code from Tencent, 9 | // please note that tRPC source code is licensed under the Apache 2.0 License, 10 | // A copy of the Apache 2.0 License is included in this file. 11 | // 12 | // 13 | 14 | #pragma once 15 | 16 | #include "trpc/util/queue/unbounded_spmc_queue.h" 17 | --------------------------------------------------------------------------------