Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
kcenon::network::protocols::grpc::health_service Class Reference

Implementation of gRPC health checking protocol. More...

#include <service_registry.h>

Inheritance diagram for kcenon::network::protocols::grpc::health_service:
Inheritance graph
Collaboration diagram for kcenon::network::protocols::grpc::health_service:
Collaboration graph

Classes

class  impl
 

Public Member Functions

 health_service ()
 
 ~health_service () override
 
 health_service (const health_service &)=delete
 
health_serviceoperator= (const health_service &)=delete
 
 health_service (health_service &&) noexcept
 
health_serviceoperator= (health_service &&) noexcept
 
auto descriptor () const -> const service_descriptor &override
 Get the service descriptor.
 
auto set_status (const std::string &service_name, health_status status) -> void
 Set health status for a service.
 
auto get_status (const std::string &service_name) const -> health_status
 Get health status for a service.
 
auto clear () -> void
 Clear all health statuses.
 
- Public Member Functions inherited from kcenon::network::protocols::grpc::service_base
virtual ~service_base ()=default
 
virtual auto is_ready () const -> bool
 Check if this service is ready to handle requests.
 

Private Attributes

std::unique_ptr< implimpl_
 

Detailed Description

Implementation of gRPC health checking protocol.

Implements the standard gRPC health checking protocol as defined in: https://github.com/grpc/grpc/blob/master/doc/health-checking.md

Definition at line 578 of file service_registry.h.

Constructor & Destructor Documentation

◆ health_service() [1/3]

kcenon::network::protocols::grpc::health_service::health_service ( )

Definition at line 857 of file service_registry.cpp.

858 : impl_(std::make_unique<impl>())
859{
860}

◆ ~health_service()

kcenon::network::protocols::grpc::health_service::~health_service ( )
overridedefault

◆ health_service() [2/3]

kcenon::network::protocols::grpc::health_service::health_service ( const health_service & )
delete

◆ health_service() [3/3]

kcenon::network::protocols::grpc::health_service::health_service ( health_service && )
defaultnoexcept

Member Function Documentation

◆ clear()

auto kcenon::network::protocols::grpc::health_service::clear ( ) -> void

Clear all health statuses.

Definition at line 884 of file service_registry.cpp.

◆ descriptor()

auto kcenon::network::protocols::grpc::health_service::descriptor ( ) const -> const service_descriptor &override
overridevirtual

Get the service descriptor.

Returns
Reference to service descriptor

Implements kcenon::network::protocols::grpc::service_base.

Definition at line 867 of file service_registry.cpp.

868{
869 return impl_->descriptor();
870}
auto descriptor() const -> const service_descriptor &

◆ get_status()

auto kcenon::network::protocols::grpc::health_service::get_status ( const std::string & service_name) const -> health_status

Get health status for a service.

Parameters
service_nameService name
Returns
Health status

Definition at line 878 of file service_registry.cpp.

880{
881 return impl_->get_status(service_name);
882}
auto get_status(const std::string &service_name) const -> health_status

◆ operator=() [1/2]

health_service & kcenon::network::protocols::grpc::health_service::operator= ( const health_service & )
delete

◆ operator=() [2/2]

health_service & kcenon::network::protocols::grpc::health_service::operator= ( health_service && )
defaultnoexcept

◆ set_status()

auto kcenon::network::protocols::grpc::health_service::set_status ( const std::string & service_name,
health_status status ) -> void

Set health status for a service.

Parameters
service_nameService name (empty string for overall status)
statusHealth status

Definition at line 872 of file service_registry.cpp.

874{
875 impl_->set_status(service_name, status);
876}
auto set_status(const std::string &service_name, health_status status) -> void

Member Data Documentation

◆ impl_

std::unique_ptr<impl> kcenon::network::protocols::grpc::health_service::impl_
private

Definition at line 619 of file service_registry.h.


The documentation for this class was generated from the following files: