What are gRPC Channels and when to use them
masterThe grpchan library provides a Channel abstraction for RPC connections. While standard gRPC uses an HTTP/2-based transport via google.golang.org/grpc, grpchan allows you to swap the underlying transport layer.
Common use cases include:
- Testing: Using an in-process transport to dispatch handlers within the same program, avoiding the overhead of serialization and network loopback.
- Alternative Transports: Using HTTP 1.1 (which supports most stream types except full-duplex bidirectional streams) or WebSockets.
- Custom Protocols: Implementing entirely new transport mechanisms for your RPC services.