Expand description
Process-wide gRPC channel pool.
The sole public function is pool::get_channel. Consumers do not
typically call it directly — the constructors generated by GrpcClient
and GrpcNoAuthClient call it internally.
Process-wide gRPC channel pool.
Channels are keyed by endpoint string and created lazily on first use.
Subsequent calls with the same endpoint string reuse the cached channel.
The pool is backed by a RwLock<HashMap<String, Channel>> and is safe to
use from multiple threads.
The sole public function is [get_channel]. Consumers do not call it
directly — the from_endpoint_with_provider and from_endpoint
constructors generated by #[derive(GrpcClient)] /
#[derive(GrpcNoAuthClient)] call it internally.
Keepalive timing is controlled by two environment variables read at channel creation time:
| Variable | Default |
|---|---|
RUST_GRPC_LIB_KEEP_ALIVE_INTERVAL_SECS | 30 |
RUST_GRPC_LIB_KEEP_ALIVE_TIMEOUT_SECS | 10 |
Functions§
- get_
channel - Return a [
Channel] forendpoint, reusing a cached one if it exists.