tikv / grpc-rs

The gRPC library for Rust built on C Core library and futures
Apache License 2.0
1.81k stars 253 forks source link

*: implements health check #518

Closed BusyJay closed 3 years ago

BusyJay commented 3 years ago

This PR provides simple health check implementations referring to the go version. It provides a HealthService to maintain the service statuses and wake up watchers.

I use a standalone crate to avoid introduce grpc specific code into the grpcio crate. And I don't reuse grpcio-proto to avoid the dependency of protobuf-build which just make things complicated by introducing a lot of dependencies and resulting in a dependency circle.

BusyJay commented 3 years ago

Most code are generated by protobuf and prost, you can just skip them as long as it compiles.

BusyJay commented 3 years ago

I add back protobuf-build to make it work well with TiKV. TiKV seems to use custom protobuf patch which doesn't work well with latest published one.

Code generated by protobuf-build in TiKV will change struct's name, so it's impossible to make them compatible with each other when generate code dynamically. Instead, I use code generated by an old version of protobuf and inline them.