Class ServerHealthContext¶
Defined in File request.h
Class Documentation¶
-
class
ServerHealthContext
¶ A ServerHealthContext object is used to query an inference server for health information.
Once created a ServerHealthContext object can be used repeatedly to get health from the server. A ServerHealthContext object can use either HTTP protocol or GRPC protocol depending on the Create function (ServerHealthHttpContext::Create or ServerHealthGrpcContext::Create). For example:
std::unique_ptr<ServerHealthContext> ctx; ServerHealthHttpContext::Create(&ctx, "localhost:8000"); bool ready; ctx->GetReady(&ready); ... bool live; ctx->GetLive(&live); ...
- Note
ServerHealthContext::Create methods are thread-safe. GetReady() and GetLive() are not thread-safe. For a given ServerHealthContext, calls to GetReady() and GetLive() must be serialized.