RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/AGENTS.md/grpc/grpc

AGENTS.md

src/core/client_channel/AGENTS.md
AGENTS.md

Quality

48/100

Scores the file, not the repository.

Length

813 words

8 headings · 0 code blocks

Repository

45k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
grpc/grpc/src/core/client_channel/AGENTS.mdRawGitHub
1# gRPC Client Channel
2 
3This directory contains the core implementation of the client-side channel in gRPC. It's responsible for managing the entire lifecycle of a connection from a client to a server, including name resolution, load balancing, and connectivity.
4 
5## Overarching Purpose
6 
7The code in this directory provides the building blocks for creating and managing client-side channels. It orchestrates the process of turning a target URI into a set of connections to backend servers, and then distributing RPCs across those connections.
8 
9## Core Concepts
10 
11The client channel is built around a few key abstractions:
12 
13* **`ClientChannel`**: The top-level object that represents a connection to a service. It owns the other components and is responsible for orchestrating the overall process of name resolution, load balancing, and connection management.
14* **`Subchannel`**: A `Subchannel` represents a connection to a single backend address. A `ClientChannel` typically manages multiple `Subchannel`s, one for each address returned by the resolver.
15* **`Resolver`**: The `Resolver` is responsible for taking a target URI (e.g., "dns:///my-service.example.com") and resolving it to a list of backend addresses. See the [resolver documentation](../resolver/AGENTS.md) for more details.
16* **`LoadBalancingPolicy`**: The `LoadBalancingPolicy` is responsible for taking the list of subchannels from the `ClientChannel` and deciding which one to use for each RPC. See the [load balancing documentation](../load_balancing/AGENTS.md) for more details.
17 
18## Legacy Architecture
19 
20The original architecture of the client channel relied heavily on callback-based filters. This approach is still present in some parts of the code, but is being actively migrated to a more modern, promise-based model.
21 
22* **`retry_filter.h`, `retry_filter.cc`**: Implements a channel filter that provides automatic retries for failed RPCs, based on the service config. This is an example of a "dynamic filter", which can be configured on a per-service or per-method basis.
23* **`dynamic_filters.h`, `dynamic_filters.cc`**: These files provide the framework for creating and managing dynamic filters.
24 
25## Modern Architecture
26 
27The newer architecture of the client channel is based on promise-based interceptors. This approach is more flexible and easier to reason about, and is the preferred way to implement new features.
28 
29* **`retry_interceptor.h`, `retry_interceptor.cc`**: Implements an interceptor that provides automatic retries for failed RPCs, based on the service config. This is the modern, promise-based replacement for `retry_filter`.
30 
31## Files
32 
33* **`client_channel.h`, `client_channel.cc`**: These files contain the main `ClientChannel` class, which is the primary implementation of the `grpc::Channel` interface for clients. It manages the entire lifecycle of a client-side channel.
34* **`subchannel.h`, `subchannel.cc`**: These files define the `Subchannel` class, which represents a connection to a single backend address.
35* **`client_channel_factory.h`, `client_channel_factory.cc`**: These files define the `ClientChannelFactory`, which is responsible for creating `ClientChannel` and `Subchannel` instances.
36* **`connector.h`**: Defines the `Connector` interface, which is responsible for establishing a transport-level connection to a given address.
37* **`load_balanced_call_destination.h`, `load_balanced_call_destination.cc`**: Defines the `LoadBalancedCallDestination`, which is a call destination that uses a `LoadBalancingPolicy` to select a subchannel for each call.
38* **`retry_filter.h`, `retry_filter.cc`**: Implements a channel filter that provides automatic retries for failed RPCs, based on the service config. This is an example of a "dynamic filter", which can be configured on a per-service or per-method basis.
39* **`retry_interceptor.h`, `retry_interceptor.cc`**: Implements an interceptor that provides automatic retries for failed RPCs, based on the service config.
40* **`config_selector.h`**: Defines the `ConfigSelector` class, which is used to select the appropriate service config for a given RPC.
41* **`subchannel_pool_interface.h`, `subchannel_pool_interface.cc`**: Defines the interface for a subchannel pool, which is used to cache and reuse subchannels.
42* **`global_subchannel_pool.h`, `global_subchannel_pool.cc`**: Implements a global subchannel pool that can be shared across multiple channels.
43 
44## Major Classes
45 
46* **`grpc_core::ClientChannel`**: The main client-side channel implementation. It integrates the [resolver](../resolver/AGENTS.md), [load balancing policy](../load_balancing/AGENTS.md), and subchannels to provide a unified view of a connection to a service.
47* **`grpc_core::Subchannel`**: Represents a single connection to a backend. It manages the connectivity state of that connection and provides a mechanism for creating transports.
48* **`grpc_core::ClientChannelFactory`**: A factory class for creating client channels and subchannels.
49* **`grpc_core::Connector`**: An interface for creating a transport-level connection.
50 
51## Notes
52 
53* The client channel is a complex piece of machinery that coordinates several different components. Understanding the roles of the [resolver](../resolver/AGENTS.md), [load balancing policy](../load_balancing/AGENTS.md), and subchannels is key to understanding how it works.
54* Much of the client channel is being migrated to a new, promise-based architecture. As a result, you will see a mix of legacy callback-based code and newer promise-based code. The `retry_filter.h` and `retry_interceptor.h` files are a good example of this transition, where the former is the legacy implementation and the latter is the new promise-based one.
55* The `dynamic_filters` are a legacy mechanism for adding filters to the channel. They are being replaced by the more flexible interceptor model.
56* The `ClientChannel` uses a `WorkSerializer` to ensure that all of its internal state is accessed in a thread-safe manner.
57* The `ConfigSelector` allows for different service configs to be used for different RPCs on the same channel. This is used to support features like per-method retry policies.
58 

Sections

  • gRPC Client Channel
  • Overarching Purpose
  • Core Concepts
  • Legacy Architecture
  • Modern Architecture
  • Files
  • Major Classes
  • Notes

Stack — with the evidence

swift

(1.00)

csharp

(1.00)

cpp

(1.00)

python

(0.60)

ruby

(0.60)

php

(0.60)

dotnet

(0.60)

ruff

(0.60)

github-actions

(0.60)

Format

AGENTS.md

A plain-markdown README for coding agents, deliberately unopinionated: no frontmatter, no globs, no vendor keys. That minimalism is why it became the one file a dozen different agents will read, and why it carries the least per-file targeting power of any format here.

What the corpus says about it

Repository

Owner
grpc
Language
—
License
—
Archived
no

All configs in this repo

Also in grpc/grpc

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
grpc/grpcsrc/core/ext/filters/census/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections25/1003 days ago
grpc/grpcsrc/core/ext/filters/gcp_authentication/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security44/1003 days ago
grpc/grpcsrc/core/ext/filters/http/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/ext/filters/stateful_session/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/ext/transport/chaotic_good/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections48/1003 days ago
grpc/grpcsrc/core/ext/transport/inproc/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/filter/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/handshaker/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections39/1003 days ago
grpc/grpcsrc/core/server/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/service_config/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/telemetry/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections39/1003 days ago
grpc/grpcsrc/core/transport/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections39/1003 days ago
grpc/grpcsrc/core/credentials/transport/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security39/1003 days ago
grpc/grpcsrc/core/ext/filters/backend_metrics/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/credentials/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security39/1003 days ago
grpc/grpcsrc/core/tsi/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security39/1003 days ago
grpc/grpcsrc/core/tsi/alts/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections39/1003 days ago
grpc/grpcsrc/core/credentials/call/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security39/1003 days ago
grpc/grpcsrc/core/ext/transport/chttp2/AGENTS.md · 45kAGENTS.mdswiftcsharp+7testarchdependencies48/1003 days ago
grpc/grpcAGENTS.md · 45kAGENTS.mdswiftcsharp+7styledependenciesdo-not54/1003 days ago
Diff against src/core/ext/filters/census/AGENTS.md Diff against src/core/ext/filters/gcp_authentication/AGENTS.md Diff against src/core/ext/filters/http/AGENTS.md Diff against src/core/ext/filters/stateful_session/AGENTS.md Diff against src/core/ext/transport/chaotic_good/AGENTS.md Diff against src/core/ext/transport/inproc/AGENTS.md Diff against src/core/filter/AGENTS.md Diff against src/core/handshaker/AGENTS.md Diff against src/core/server/AGENTS.md Diff against src/core/service_config/AGENTS.md Diff against src/core/telemetry/AGENTS.md Diff against src/core/transport/AGENTS.md Diff against src/core/credentials/transport/AGENTS.md Diff against src/core/ext/filters/backend_metrics/AGENTS.md Diff against src/core/credentials/AGENTS.md Diff against src/core/tsi/AGENTS.md Diff against src/core/tsi/alts/AGENTS.md Diff against src/core/credentials/call/AGENTS.md Diff against src/core/ext/transport/chttp2/AGENTS.md Diff against AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
vllm-project/vllmAGENTS.md · 88kAGENTS.mdpythonpytorch+3setuptestlint-formatstyle+5100/1003 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
react/react-nativepackages/react-native-compatibility-check/AGENTS.md · 126kAGENTS.mdreactreact-native+11testlint-formatstylearch+499/1003 days ago
netdata/netdatasrc/go/plugin/ibm.d/AGENTS.md · 80kAGENTS.mddockerinfrastructure+7buildtestlint-formatarch+399/1003 days ago
dragonflydb/dragonflyAGENTS.md · 31kAGENTS.mdcppredis+6setupbuildtestlint-format+1096/1002 days ago
dotnet/aspnetcoresrc/Components/AGENTS.md · 38kAGENTS.mdcsharpdotnet+5buildteststylearch+396/1003 days ago
duckdb/duckdbAGENTS.md · 40kAGENTS.mdcppswift+1buildtestlint-formatstyle+896/100today
steipete/CodexBarAGENTS.md · 20kAGENTS.mdswiftgithub-actionsbuildteststylearch+493/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack