This directory is the heart of the gRPC C++ core, defining the fundamental data structures and mechanisms for representing and managing a single RPC.
See also: gRPC Core overview
The code in this directory provides the client and server-side representations of a call, the central “spine” that connects them, and the various components needed to manage the lifecycle of an RPC, including metadata, messages, and status.
CallSpine: The CallSpine is the central component of a gRPC call. It encapsulates the call's context, including the arena allocator, call filters, and the pipes for message and metadata communication. The CallSpine is shared between a CallInitiator (the client-side) and a CallHandler (the server-side).CallInitiator: The CallInitiator is the client-side view of a call. It is used for initiating requests and receiving responses.CallHandler: The CallHandler is the server-side view of a call. It is used for handling incoming requests and sending responses.ClientCall: The ClientCall is the public client-side API for a call. It wraps the CallInitiator and CallSpine.ServerCall: The ServerCall is the public server-side API for a call. It wraps the CallHandler and CallSpine.FilterStackCall (filter_stack_call.h)ClientCall (client_call.h)ServerCall (server_call.h)Partygrpc_call_createMakeClientCall and MakeServerCallsrc/core/lib/surface/filter_stack_call.{h,cc}src/core/lib/surface/legacy_channel.{h,cc}src/core/lib/channel/channel_stack.{h,cc}src/core/lib/channel/channel_stack_builder.{h,cc}src/core/ext/filters/channel_idle/legacy_channel_idle_filter.ccsrc/core/call/client_call.{h,cc}src/core/call/server_call.{h,cc}src/core/call/call_spine.{h,cc}src/core/call/call_filters.{h,cc}src/core/client_channel/direct_channel.{h,cc}src/core/lib/surface/call.{h,cc}src/core/lib/surface/call_utils.{h,cc}src/core/call/metadata.{h,cc}src/core/call/metadata_batch.{h,cc}src/core/call/call_spine.{h,cc}: The CallSpine is the key abstraction to understand in this directory. It's the “glue” that holds a call together.CallInitiator and CallHandler provides a clean separation of concerns between the client and server sides of a call.CallInitiator and CallHandler pair.CallInitiator is always near/towards the client side.CallHandler is always near/towards the server side.src/core/call/client_call.{h,cc}: These files define the ClientCall class.src/core/call/server_call.{h,cc}: These files define the ServerCall class.src/core/call/metadata.{h,cc}, src/core/call/metadata_batch.{h,cc}: These files provide the data structures for representing and manipulating RPC metadata.src/core/call/message.{h,cc}: Defines the Message class, which is a container for RPC messages.src/core/call/call_filters.{h,cc}: These files define the CallFilters class, which is responsible for managing the filters for a call.src/core/call/interception_chain.{h,cc}: These files define the InterceptionChain class, which is used to manage the execution of a set of interceptors.CallFilters class is responsible for managing the filters for a call. See the channel documentation for more information about filters.