I want to use grpc connection manangement and IO Multiplexing ability of gRPC to manage cluster mode redis connection. Can I inherit from a gRPC channel to implement redis protocol? and How?
It is impossible to simply inherit gRPC.Channel to work with Redis, because gRPC works on top of HTTP/2 with proto-buffers, and Redis uses its own unique protocol (RESP). These formats are incompatible. Even if you inherit, you need to completely rewrite the logic to adapt gRPC.Channel to work with the Redis protocol, which negates the point of inheritance. gRPC is designed to call methods on remote services, and not to work with arbitrary protocols, like Redis.
Still gRPC can be used for connection management and I/O multiplexing, but this is only possible if you implement your own transport and protocol for Redis on top of gRPC.
While gRPC provides excellent connection management and concurrency support, using it in the context of Redis can be a complex and inefficient solution. For using Redis in a cluster, it is much easier to use specialized client libraries such as redis-py, which already take into account the specifics of Redis working with a cluster, connection management, and multiplexing.