|
asio-grpc v3.5.0
Asynchronous gRPC with Asio/unified executors
|
CompletionQueue-based implementation of grpc::HealthCheckServiceInterface. More...
#include <agrpc/health_check_service.hpp>
Public Member Functions | |
| void | SetServingStatus (const std::string &service_name, bool serving) |
| Set or change the serving status of the given service_name. | |
| void | SetServingStatus (bool serving) |
| Apply a serving status to all registered service names. | |
| void | Shutdown () |
| Set all registered service names to not serving and prevent future state changes. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| grpc::ServerBuilder & | add_health_check_service (grpc::ServerBuilder &builder) |
Add a HealthCheckService to a grpc::Server | |
| void | start_health_check_service (agrpc::HealthCheckService &service, agrpc::GrpcContext &grpc_context) |
| Start a previously added HealthCheckService. | |
| void | start_health_check_service (grpc::Server &server, agrpc::GrpcContext &grpc_context) |
Start a previously added HealthCheckService (grpc::Server overload) | |
CompletionQueue-based implementation of grpc::HealthCheckServiceInterface.
This class is a drop-in replacement for the grpc::DefaultHealthCheckService. It should be added to a grpc::ServerBuilder using add_health_check_service().
Motivation: grpc::DefaultHealthCheckService is implemented in terms of gRPC's generic callback API. Mixing callback services and CompletionQueue-based services in one grpc::Server significantly degrades performance.
__has_include then you must also include health.grpc.pb.h before including agrpc/health_check_service.hpp.
|
inline |
Set or change the serving status of the given service_name.
Thread-safe
|
inline |
Apply a serving status to all registered service names.
Thread-safe
|
inline |
Set all registered service names to not serving and prevent future state changes.
Thread-safe
|
related |
Add a HealthCheckService to a grpc::Server
Must be called before grpc::ServerBuilder.BuildAndStart() and the service must be started using start_health_check_service() afterwards. May only be called once for a given ServerBuilder.
Example:
|
related |
Start a previously added HealthCheckService.
Must be called after grpc::ServerBuilder.BuildAndStart(). The service must have been added using add_health_check_service(). May only be called once for a given HealthCheckService.
Does not contribute to the work tracking of the GrpcContext.
GrpcContext::run/poll. May not be used with a multi-threaded GrpcContext.GrpcContext::run/poll_completion_queue then none of the member functions of the service may be used.
|
related |
Start a previously added HealthCheckService (grpc::Server overload)
The service must have been added using add_health_check_service(). May only be called once for a given HealthCheckService.
Effectively performs: