default_health_check_service.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2016 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H
20 #define GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H
21 
22 #include <atomic>
23 #include <functional>
24 #include <map>
25 #include <memory>
26 #include <set>
27 #include <string>
28 #include <utility>
29 
30 #include <grpc/support/log.h>
32 #include <grpcpp/grpcpp.h>
34 #include <grpcpp/impl/codegen/async_generic_service.h> // IWYU pragma: keep
35 #include <grpcpp/impl/codegen/async_unary_call.h> // IWYU pragma: keep
38 #include <grpcpp/support/config.h>
39 #include <grpcpp/support/status.h>
40 
42 #include "src/core/lib/gprpp/thd.h"
43 
44 namespace grpc {
45 
46 // Default implementation of HealthCheckServiceInterface. Server will create and
47 // own it.
49  public:
51 
52  // The service impl to register with the server.
54  public:
55  // Base class for call handlers.
56  class CallHandler {
57  public:
58  virtual ~CallHandler() = default;
59  virtual void SendHealth(std::shared_ptr<CallHandler> self,
60  ServingStatus status) = 0;
61  };
62 
64  std::unique_ptr<ServerCompletionQueue> cq);
65 
66  ~HealthCheckServiceImpl() override;
67 
68  void StartServingThread();
69 
70  private:
71  // A tag that can be called with a bool argument. It's tailored for
72  // CallHandler's use. Before being used, it should be constructed with a
73  // method of CallHandler and a shared pointer to the handler. The
74  // shared pointer will be moved to the invoked function and the function
75  // can only be invoked once. That makes ref counting of the handler easier,
76  // because the shared pointer is not bound to the function and can be gone
77  // once the invoked function returns (if not used any more).
78  class CallableTag {
79  public:
80  using HandlerFunction =
81  std::function<void(std::shared_ptr<CallHandler>, bool)>;
82 
84 
85  CallableTag(HandlerFunction func, std::shared_ptr<CallHandler> handler)
87  GPR_ASSERT(handler_function_ != nullptr);
88  GPR_ASSERT(handler_ != nullptr);
89  }
90 
91  // Runs the tag. This should be called only once. The handler is no
92  // longer owned by this tag after this method is invoked.
93  void Run(bool ok) {
94  GPR_ASSERT(handler_function_ != nullptr);
95  GPR_ASSERT(handler_ != nullptr);
97  }
98 
99  // Releases and returns the shared pointer to the handler.
100  std::shared_ptr<CallHandler> ReleaseHandler() {
101  return std::move(handler_);
102  }
103 
104  private:
106  std::shared_ptr<CallHandler> handler_;
107  };
108 
109  // Call handler for Check method.
110  // Each handler takes care of one call. It contains per-call data and it
111  // will access the members of the parent class (i.e.,
112  // DefaultHealthCheckService) for per-service health data.
113  class CheckCallHandler : public CallHandler {
114  public:
115  // Instantiates a CheckCallHandler and requests the next health check
116  // call. The handler object will manage its own lifetime, so no action is
117  // needed from the caller any more regarding that object.
121 
122  // This ctor is public because we want to use std::make_shared<> in
123  // CreateAndStart(). This ctor shouldn't be used elsewhere.
127 
128  // Not used for Check.
129  void SendHealth(std::shared_ptr<CallHandler> /*self*/,
130  ServingStatus /*status*/) override {}
131 
132  private:
133  // Called when we receive a call.
134  // Spawns a new handler so that we can keep servicing future calls.
135  void OnCallReceived(std::shared_ptr<CallHandler> self, bool ok);
136 
137  // Called when Finish() is done.
138  void OnFinishDone(std::shared_ptr<CallHandler> self, bool ok);
139 
140  // The members passed down from HealthCheckServiceImpl.
144 
148 
150  };
151 
152  // Call handler for Watch method.
153  // Each handler takes care of one call. It contains per-call data and it
154  // will access the members of the parent class (i.e.,
155  // DefaultHealthCheckService) for per-service health data.
156  class WatchCallHandler : public CallHandler {
157  public:
158  // Instantiates a WatchCallHandler and requests the next health check
159  // call. The handler object will manage its own lifetime, so no action is
160  // needed from the caller any more regarding that object.
164 
165  // This ctor is public because we want to use std::make_shared<> in
166  // CreateAndStart(). This ctor shouldn't be used elsewhere.
170 
171  void SendHealth(std::shared_ptr<CallHandler> self,
172  ServingStatus status) override;
173 
174  private:
175  // Called when we receive a call.
176  // Spawns a new handler so that we can keep servicing future calls.
177  void OnCallReceived(std::shared_ptr<CallHandler> self, bool ok);
178 
179  // Requires holding send_mu_.
180  void SendHealthLocked(std::shared_ptr<CallHandler> self,
182 
183  // When sending a health result finishes.
184  void OnSendHealthDone(std::shared_ptr<CallHandler> self, bool ok);
185 
186  void SendFinish(std::shared_ptr<CallHandler> self, const Status& status);
187 
188  // Requires holding service_->cq_shutdown_mu_.
189  void SendFinishLocked(std::shared_ptr<CallHandler> self,
190  const Status& status);
191 
192  // Called when Finish() is done.
193  void OnFinishDone(std::shared_ptr<CallHandler> self, bool ok);
194 
195  // Called when AsyncNotifyWhenDone() notifies us.
196  void OnDoneNotified(std::shared_ptr<CallHandler> self, bool ok);
197 
198  // The members passed down from HealthCheckServiceImpl.
202 
207 
209  bool send_in_flight_ = false; // Guarded by mu_.
211 
212  bool finish_called_ = false;
216  };
217 
218  // Handles the incoming requests and drives the completion queue in a loop.
219  static void Serve(void* arg);
220 
221  // Returns true on success.
222  static bool DecodeRequest(const ByteBuffer& request,
223  std::string* service_name);
225 
226  // Needed to appease Windows compilers, which don't seem to allow
227  // nested classes to access protected members in the parent's
228  // superclass.
231 
233  std::unique_ptr<ServerCompletionQueue> cq_;
234 
235  // To synchronize the operations related to shutdown state of cq_, so that
236  // we don't enqueue new tags into cq_ after it is already shut down.
238  std::atomic_bool shutdown_{false};
239  std::unique_ptr<grpc_core::Thread> thread_;
240  };
241 
243 
244  void SetServingStatus(const std::string& service_name, bool serving) override;
245  void SetServingStatus(bool serving) override;
246 
247  void Shutdown() override;
248 
249  ServingStatus GetServingStatus(const std::string& service_name) const;
250 
252  std::unique_ptr<ServerCompletionQueue> cq);
253 
254  private:
255  // Stores the current serving status of a service and any call
256  // handlers registered for updates when the service's status changes.
257  class ServiceData {
258  public:
261  void AddCallHandler(
262  std::shared_ptr<HealthCheckServiceImpl::CallHandler> handler);
263  void RemoveCallHandler(
264  const std::shared_ptr<HealthCheckServiceImpl::CallHandler>& handler);
265  bool Unused() const {
266  return call_handlers_.empty() && status_ == NOT_FOUND;
267  }
268 
269  private:
271  std::set<std::shared_ptr<HealthCheckServiceImpl::CallHandler>>
273  };
274 
275  void RegisterCallHandler(
276  const std::string& service_name,
277  std::shared_ptr<HealthCheckServiceImpl::CallHandler> handler);
278 
280  const std::string& service_name,
281  const std::shared_ptr<HealthCheckServiceImpl::CallHandler>& handler);
282 
284  bool shutdown_ = false; // Guarded by mu_.
285  std::map<std::string, ServiceData> services_map_; // Guarded by mu_.
286  std::unique_ptr<HealthCheckServiceImpl> impl_;
287 };
288 
289 } // namespace grpc
290 
291 #endif // GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallHandler
Definition: default_health_check_service.h:56
grpc::DefaultHealthCheckService::NOT_SERVING
@ NOT_SERVING
Definition: default_health_check_service.h:50
grpc::status
auto status
Definition: cpp/client/credentials_test.cc:200
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallableTag::CallableTag
CallableTag(HandlerFunction func, std::shared_ptr< CallHandler > handler)
Definition: default_health_check_service.h:85
grpc::ServerCompletionQueue
Definition: include/grpcpp/impl/codegen/completion_queue.h:436
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::SendHealthLocked
void SendHealthLocked(std::shared_ptr< CallHandler > self, ServingStatus status)
Definition: default_health_check_service.cc:416
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::database_
DefaultHealthCheckService * database_
Definition: default_health_check_service.h:200
grpc::ServerContext
Definition: grpcpp/impl/codegen/server_context.h:566
log.h
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::on_finish_done_
CallableTag on_finish_done_
Definition: default_health_check_service.h:215
grpc::DefaultHealthCheckService::impl_
std::unique_ptr< HealthCheckServiceImpl > impl_
Definition: default_health_check_service.h:286
grpc
Definition: grpcpp/alarm.h:33
grpc::Service::RequestAsyncUnary
void RequestAsyncUnary(int index, grpc::ServerContext *context, Message *request, internal::ServerAsyncStreamingInterface *stream, grpc::CompletionQueue *call_cq, grpc::ServerCompletionQueue *notification_cq, void *tag)
Definition: grpcpp/impl/codegen/service_type.h:105
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::cq_
ServerCompletionQueue * cq_
Definition: default_health_check_service.h:199
grpc::DefaultHealthCheckService::ServiceData::GetServingStatus
ServingStatus GetServingStatus() const
Definition: default_health_check_service.h:260
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallableTag::CallableTag
CallableTag()
Definition: default_health_check_service.h:83
grpc::DefaultHealthCheckService::RegisterCallHandler
void RegisterCallHandler(const std::string &service_name, std::shared_ptr< HealthCheckServiceImpl::CallHandler > handler)
Definition: default_health_check_service.cc:97
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::database_
DefaultHealthCheckService * database_
Definition: default_health_check_service.h:142
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallableTag::ReleaseHandler
std::shared_ptr< CallHandler > ReleaseHandler()
Definition: default_health_check_service.h:100
benchmark.request
request
Definition: benchmark.py:77
grpc::DefaultHealthCheckService::ServingStatus
ServingStatus
Definition: default_health_check_service.h:50
grpc::DefaultHealthCheckService::NOT_FOUND
@ NOT_FOUND
Definition: default_health_check_service.h:50
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::OnCallReceived
void OnCallReceived(std::shared_ptr< CallHandler > self, bool ok)
Definition: default_health_check_service.cc:287
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallableTag::Run
void Run(bool ok)
Definition: default_health_check_service.h:93
health_check_service_interface.h
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::send_in_flight_
bool send_in_flight_
Definition: default_health_check_service.h:209
async_generic_service.h
grpc::DefaultHealthCheckService::UnregisterCallHandler
void UnregisterCallHandler(const std::string &service_name, const std::shared_ptr< HealthCheckServiceImpl::CallHandler > &handler)
Definition: default_health_check_service.cc:107
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallableTag::handler_
std::shared_ptr< CallHandler > handler_
Definition: default_health_check_service.h:106
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::CreateAndStart
static void CreateAndStart(ServerCompletionQueue *cq, DefaultHealthCheckService *database, HealthCheckServiceImpl *service)
Definition: default_health_check_service.cc:342
grpc::DefaultHealthCheckService::GetHealthCheckService
HealthCheckServiceImpl * GetHealthCheckService(std::unique_ptr< ServerCompletionQueue > cq)
Definition: default_health_check_service.cc:121
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallHandler::~CallHandler
virtual ~CallHandler()=default
grpc::DefaultHealthCheckService::mu_
grpc_core::Mutex mu_
Definition: default_health_check_service.h:283
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::DecodeRequest
static bool DecodeRequest(const ByteBuffer &request, std::string *service_name)
Definition: default_health_check_service.cc:209
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::cq_shutdown_mu_
grpc_core::Mutex cq_shutdown_mu_
Definition: default_health_check_service.h:237
grpc::Service
Desriptor of an RPC service and its various RPC methods.
Definition: grpcpp/impl/codegen/service_type.h:58
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::database_
DefaultHealthCheckService * database_
Definition: default_health_check_service.h:232
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::send_mu_
grpc_core::Mutex send_mu_
Definition: default_health_check_service.h:208
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::next_
CallableTag next_
Definition: default_health_check_service.h:213
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::request_
ByteBuffer request_
Definition: default_health_check_service.h:203
async_unary_call.h
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::thread_
std::unique_ptr< grpc_core::Thread > thread_
Definition: default_health_check_service.h:239
grpc::DefaultHealthCheckService::ServiceData
Definition: default_health_check_service.h:257
grpc::DefaultHealthCheckService::services_map_
std::map< std::string, ServiceData > services_map_
Definition: default_health_check_service.h:285
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler
Definition: default_health_check_service.h:113
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallableTag
Definition: default_health_check_service.h:78
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::service_name_
std::string service_name_
Definition: default_health_check_service.h:204
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::CreateAndStart
static void CreateAndStart(ServerCompletionQueue *cq, DefaultHealthCheckService *database, HealthCheckServiceImpl *service)
Definition: default_health_check_service.cc:261
grpc::DefaultHealthCheckService::DefaultHealthCheckService
DefaultHealthCheckService()
Definition: default_health_check_service.cc:47
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::OnFinishDone
void OnFinishDone(std::shared_ptr< CallHandler > self, bool ok)
Definition: default_health_check_service.cc:474
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::OnCallReceived
void OnCallReceived(std::shared_ptr< CallHandler > self, bool ok)
Definition: default_health_check_service.cc:375
async_generic_service.h
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::service_
HealthCheckServiceImpl * service_
Definition: default_health_check_service.h:143
grpc::DefaultHealthCheckService::ServiceData::AddCallHandler
void AddCallHandler(std::shared_ptr< HealthCheckServiceImpl::CallHandler > handler)
Definition: default_health_check_service.cc:140
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::finish_called_
bool finish_called_
Definition: default_health_check_service.h:212
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::SendHealth
void SendHealth(std::shared_ptr< CallHandler > self, ServingStatus status) override
Definition: default_health_check_service.cc:403
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::HealthCheckServiceImpl
HealthCheckServiceImpl(DefaultHealthCheckService *database, std::unique_ptr< ServerCompletionQueue > cq)
Definition: default_health_check_service.cc:159
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallableTag::HandlerFunction
std::function< void(std::shared_ptr< CallHandler >, bool)> HandlerFunction
Definition: default_health_check_service.h:81
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::shutdown_
std::atomic_bool shutdown_
Definition: default_health_check_service.h:238
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::service_
HealthCheckServiceImpl * service_
Definition: default_health_check_service.h:201
grpcpp.h
arg
Definition: cmdline.cc:40
grpc::DefaultHealthCheckService
Definition: default_health_check_service.h:48
database
database
Definition: benchmark/.ycm_extra_conf.py:35
grpc::DefaultHealthCheckService::ServiceData::Unused
bool Unused() const
Definition: default_health_check_service.h:265
grpc::ByteBuffer
A sequence of bytes.
Definition: include/grpcpp/impl/codegen/byte_buffer.h:61
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::CheckCallHandler
CheckCallHandler(ServerCompletionQueue *cq, DefaultHealthCheckService *database, HealthCheckServiceImpl *service)
Definition: default_health_check_service.cc:281
grpc::DefaultHealthCheckService::GetServingStatus
ServingStatus GetServingStatus(const std::string &service_name) const
Definition: default_health_check_service.cc:86
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::cq_
std::unique_ptr< ServerCompletionQueue > cq_
Definition: default_health_check_service.h:233
grpc::Service::RequestAsyncServerStreaming
void RequestAsyncServerStreaming(int index, grpc::ServerContext *context, Message *request, internal::ServerAsyncStreamingInterface *stream, grpc::CompletionQueue *call_cq, grpc::ServerCompletionQueue *notification_cq, void *tag)
Definition: grpcpp/impl/codegen/service_type.h:128
grpc::DefaultHealthCheckService::shutdown_
bool shutdown_
Definition: default_health_check_service.h:284
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::OnFinishDone
void OnFinishDone(std::shared_ptr< CallHandler > self, bool ok)
Definition: default_health_check_service.cc:329
config.h
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::stream_
GenericServerAsyncWriter stream_
Definition: default_health_check_service.h:205
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::SendHealth
void SendHealth(std::shared_ptr< CallHandler >, ServingStatus) override
Definition: default_health_check_service.h:129
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::~HealthCheckServiceImpl
~HealthCheckServiceImpl() override
Definition: default_health_check_service.cc:174
grpc::HealthCheckServiceInterface
Definition: grpcpp/health_check_service_interface.h:31
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::cq_
ServerCompletionQueue * cq_
Definition: default_health_check_service.h:141
grpc::DefaultHealthCheckService::ServiceData::SetServingStatus
void SetServingStatus(ServingStatus status)
Definition: default_health_check_service.cc:132
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::WatchCallHandler
WatchCallHandler(ServerCompletionQueue *cq, DefaultHealthCheckService *database, HealthCheckServiceImpl *service)
Definition: default_health_check_service.cc:369
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::writer_
GenericServerAsyncResponseWriter writer_
Definition: default_health_check_service.h:146
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::SendFinishLocked
void SendFinishLocked(std::shared_ptr< CallHandler > self, const Status &status)
Definition: default_health_check_service.cc:464
grpc_core::Mutex
Definition: src/core/lib/gprpp/sync.h:61
grpc::DefaultHealthCheckService::ServiceData::call_handlers_
std::set< std::shared_ptr< HealthCheckServiceImpl::CallHandler > > call_handlers_
Definition: default_health_check_service.h:272
func
const EVP_CIPHER *(* func)(void)
Definition: cipher_extra.c:73
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::SendFinish
void SendFinish(std::shared_ptr< CallHandler > self, const Status &status)
Definition: default_health_check_service.cc:456
grpc::DefaultHealthCheckService::SERVING
@ SERVING
Definition: default_health_check_service.h:50
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::next_
CallableTag next_
Definition: default_health_check_service.h:149
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::request_
ByteBuffer request_
Definition: default_health_check_service.h:145
grpc::DefaultHealthCheckService::ServiceData::RemoveCallHandler
void RemoveCallHandler(const std::shared_ptr< HealthCheckServiceImpl::CallHandler > &handler)
Definition: default_health_check_service.cc:145
client.handler
handler
Definition: examples/python/multiprocessing/client.py:87
asyncio_get_stats.response
response
Definition: asyncio_get_stats.py:28
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::OnDoneNotified
void OnDoneNotified(std::shared_ptr< CallHandler > self, bool ok)
Definition: default_health_check_service.cc:488
thd.h
grpc::Status
Definition: include/grpcpp/impl/codegen/status.h:35
service_type.h
ok
bool ok
Definition: async_end2end_test.cc:197
grpc::DefaultHealthCheckService::ServiceData::status_
ServingStatus status_
Definition: default_health_check_service.h:270
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::OnSendHealthDone
void OnSendHealthDone(std::shared_ptr< CallHandler > self, bool ok)
Definition: default_health_check_service.cc:439
grpc::DefaultHealthCheckService::Shutdown
void Shutdown() override
Definition: default_health_check_service.cc:73
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::on_done_notified_
CallableTag on_done_notified_
Definition: default_health_check_service.h:214
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallHandler::SendHealth
virtual void SendHealth(std::shared_ptr< CallHandler > self, ServingStatus status)=0
grpc::DefaultHealthCheckService::HealthCheckServiceImpl
Definition: default_health_check_service.h:53
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::ctx_
ServerContext ctx_
Definition: default_health_check_service.h:206
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::Serve
static void Serve(void *arg)
Definition: default_health_check_service.cc:194
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::ctx_
ServerContext ctx_
Definition: default_health_check_service.h:147
grpc::ServerAsyncResponseWriter< ByteBuffer >
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler::pending_status_
ServingStatus pending_status_
Definition: default_health_check_service.h:210
service
__attribute__((deprecated("Please use GRPCProtoMethod."))) @interface ProtoMethod NSString * service
Definition: ProtoMethod.h:25
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::StartServingThread
void StartServingThread()
Definition: default_health_check_service.cc:184
grpc::ServerAsyncWriter< ByteBuffer >
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::EncodeResponse
static bool EncodeResponse(ServingStatus status, ByteBuffer *response)
Definition: default_health_check_service.cc:233
cq
static grpc_completion_queue * cq
Definition: test/core/fling/client.cc:37
sync.h
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::WatchCallHandler
Definition: default_health_check_service.h:156
status.h
grpc::DefaultHealthCheckService::HealthCheckServiceImpl::CallableTag::handler_function_
HandlerFunction handler_function_
Definition: default_health_check_service.h:105
byte_buffer.h
grpc::DefaultHealthCheckService::SetServingStatus
void SetServingStatus(const std::string &service_name, bool serving) override
Set or change the serving status of the given service_name.
Definition: default_health_check_service.cc:51


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:09