How everythingfornothing/trpc-cpp works
tRPC-Cpp is an RPC framework for building network services and clients. A typical call starts in a client proxy, passes through transport and protocol encoding, reaches a server adapter, and is dispatched to a service; replies follow the transport path back. The repository also provides runtime scheduling, streaming, admin management, configuration, naming, observability, overload controls, and protocol/compression plugins. The README supports the major capabilities and layer responsibilities; source excerpts provide only selected implementation links, so uncertain wiring is omitted or marked dashed.
Main entry points: service_adapter.cc Service Adapter · service_proxy.cc Client Proxies · protocol.h Protocol Model · runtime_manager.cc Runtime Manager
Components 22
RPC Services
- Client Proxies
trpc/client/service_proxy.cc - Client Context
trpc/client/client_context.h - Service Adapter
trpc/server/service_adapter.cc - Server Context
trpc/server/server_context.h - Streaming RPC
trpc/stream/stream_handler_manager.cc
Transport Protocols
- Protocol Model
trpc/codec/protocol.h - Codec Registry
trpc/codec/codec_manager.cc - gRPC and HTTP
trpc/codec/grpc/grpc_protocol.cc - Redis Client
trpc/client/redis/redis_service_proxy.cc
Runtime Execution
- Runtime Manager
trpc/common/runtime_manager.cc - Fiber Runtime
trpc/runtime/fiber_runtime.h - Reactor I/O
trpc/runtime/iomodel/reactor/default/reactor_impl.cc
Plugins and Controls
- Framework Config
trpc/common/config/trpc_config.h - Service Naming
trpc/naming/selector_workflow.cc - Compression
trpc/compressor/compressor_factory.cc - Request Filters
trpc/filter/server_filter_controller.cc - Overload Control
trpc/overload_control/high_percentile/high_percentile_overload_controller.cc
Operations and Observability
- Admin Interface
trpc/admin/admin_service.cc - Metrics
trpc/metrics/trpc_metrics.cc - RPC Tracing
trpc/rpcz/trpc_rpcz.cc
Other components
- Application Caller
- Remote Service
Connections 22
- Application Caller → Client Proxies: invokes
README.md - Client Proxies → Client Context: uses context
- Client Proxies → Protocol Model: encodes calls
- Protocol Model → Remote Service: transmits messages
README.md - Remote Service → Service Adapter: delivers requests
- Service Adapter → Server Context: dispatches requests
trpc/server/service_adapter.cc - Service Adapter → Protocol Model: decodes messages
- Client Proxies → Streaming RPC: supports streaming
README.md - Service Adapter → Streaming RPC: supports streaming
README.md - Runtime Manager → Fiber Runtime: initializes runtime
trpc/common/runtime_manager.cc - Runtime Manager → Framework Config: reads settings
trpc/common/runtime_manager.cc - Runtime Manager → Metrics: initializes plugin
trpc/common/runtime_manager.cc - Service Adapter → Request Filters: runs filters
- Service Adapter → Overload Control: applies controls
- Client Proxies → Service Naming: selects endpoints
- Codec Registry → gRPC and HTTP: registers codecs
trpc/codec/codec_manager.cc - Client Proxies → Redis Client: offers component
README.md - Protocol Model → Compression: supports compression
README.md - Admin Interface → Remote Service: manages service
README.md - Service Adapter → RPC Tracing: supports tracing
README.md - Service Adapter → Metrics: reports metrics
- Reactor I/O → Remote Service: handles network I/O
README.md