19 #ifndef GRPCPP_SERVER_IMPL_H 20 #define GRPCPP_SERVER_IMPL_H 22 #include <condition_variable> 47 class AsyncGenericService;
50 class ExternalConnectionAcceptorImpl;
108 return health_check_service_.get();
123 std::shared_ptr<Channel> InProcessChannelWithInterceptors(
125 std::vector<std::unique_ptr<
127 interceptor_creators);
186 std::shared_ptr<std::vector<std::unique_ptr<ServerCompletionQueue>>>
188 int min_pollers,
int max_pollers,
int sync_cq_timeout_msec,
190 std::shared_ptr<grpc::internal::ExternalConnectionAcceptorImpl>>
193 std::vector<std::unique_ptr<
195 interceptor_creators = std::vector<std::unique_ptr<
211 std::unique_ptr<grpc::HealthCheckServiceInterface> service) {
212 health_check_service_ = std::move(service);
217 return health_check_service_disabled_;
222 std::unique_ptr<grpc::experimental::ServerInterceptorFactoryInterface>>*
223 interceptor_creators()
override {
224 return &interceptor_creators_;
232 class CallbackRequestBase;
233 template <
class ServerContextType>
234 class CallbackRequest;
235 class UnimplementedAsyncRequest;
236 class UnimplementedAsyncResponse;
242 class SyncRequestThreadManager;
252 class experimental_registration_type final
255 explicit experimental_registration_type(
Server* server) : server_(server) {}
256 void RegisterCallbackGenericService(
258 server_->RegisterCallbackGenericService(service);
266 void RegisterCallbackGenericService(
273 return &experimental_registration_;
281 int max_receive_message_size()
const override {
282 return max_receive_message_size_;
289 std::vector<std::shared_ptr<grpc::internal::ExternalConnectionAcceptorImpl>>
298 std::unique_ptr<grpc::experimental::ServerInterceptorFactoryInterface>>
299 interceptor_creators_;
301 const int max_receive_message_size_;
306 std::shared_ptr<std::vector<std::unique_ptr<ServerCompletionQueue>>>
311 std::vector<std::unique_ptr<SyncRequestThreadManager>> sync_req_mgrs_;
318 std::vector<gpr_atm> callback_unmatched_reqs_count_;
321 std::list<CallbackRequestBase*> callback_reqs_to_start_;
325 experimental_registration_type experimental_registration_{
this};
331 bool shutdown_notified_;
344 std::atomic<intptr_t> callback_reqs_outstanding_{0};
346 std::shared_ptr<GlobalCallbacks> global_callbacks_;
348 std::vector<grpc::string> services_;
349 bool has_async_generic_service_{
false};
350 bool has_callback_generic_service_{
false};
355 std::unique_ptr<grpc_impl::ServerInitializer> server_initializer_;
357 std::unique_ptr<grpc::HealthCheckServiceInterface> health_check_service_;
358 bool health_check_service_disabled_;
362 std::unique_ptr<grpc::experimental::CallbackGenericService>
363 unimplemented_service_;
366 std::unique_ptr<grpc::internal::MethodHandler> resource_exhausted_handler_;
369 std::unique_ptr<grpc::internal::MethodHandler> generic_handler_;
381 #endif // GRPCPP_SERVER_IMPL_H
grpc::HealthCheckServiceInterface * GetHealthCheckService() const
Returns the health check service.
Definition: server_impl.h:107
std::string string
Definition: config.h:35
bool health_check_service_disabled() const
NOTE: This method is not part of the public API for this class.
Definition: server_impl.h:216
Represents a gRPC server.
Definition: server_impl.h:64
NOTE: class experimental_registration_interface is not part of the public API of this class TODO(vjpa...
Definition: server_interface.h:128
::grpc_impl::Server Server
Definition: server.h:26
Desriptor of an RPC service and its various RPC methods.
Definition: service_type.h:60
Global callbacks are a set of hooks that are called when server events occur.
Definition: server_impl.h:80
virtual void PreServerStart(Server *server)
Called before server is started.
Definition: server_impl.h:90
struct grpc_server grpc_server
A server listens to some port and responds to request calls.
Definition: grpc_types.h:65
virtual void AddPort(Server *server, const grpc::string &addr, grpc::ServerCredentials *creds, int port)
Called after a server port is added.
Definition: server_impl.h:92
Definition: async_generic_service.h:74
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:38
NOTE: class experimental_type is not part of the public API of this class.
Definition: server_impl.h:117
::grpc_impl::ServerContext ServerContext
Definition: server_context.h:25
A ServerContext allows the person implementing a service handler to:
Definition: server_context_impl.h:118
void set_health_check_service(std::unique_ptr< grpc::HealthCheckServiceInterface > service)
NOTE: This method is not part of the public API for this class.
Definition: server_impl.h:210
Definition: server_interceptor.h:47
virtual void UpdateArguments(ChannelArguments *args)
Called before server is created.
Definition: server_impl.h:84
Definition: client_interceptor.h:49
The gRPC server uses this interface to expose the health checking service without depending on protob...
Definition: health_check_service_interface_impl.h:28
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
Options for channel creation.
Definition: channel_arguments_impl.h:43
Definition: server_interface.h:57
::grpc_impl::HealthCheckServiceInterface HealthCheckServiceInterface
Definition: health_check_service_interface.h:29
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
CallbackGenericService is the base class for generic services implemented using the callback API and ...
Definition: async_generic_service.h:129
Wrapper around grpc_server_credentials, a way to authenticate a server.
Definition: server_credentials_impl.h:39
An abstract collection of call ops, used to generate the grpc_call_op structure to pass down to the l...
Definition: call_op_set_interface.h:34
experimental_type(Server *server)
Definition: server_impl.h:119
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue_impl.h:101
struct grpc_resource_quota grpc_resource_quota
Definition: grpc_types.h:661
experimental_type experimental()
NOTE: The function experimental() is not stable public API.
Definition: server_impl.h:136
Analogous to struct timespec.
Definition: gpr_types.h:47
::grpc_impl::ServerInitializer ServerInitializer
Definition: server_initializer.h:26
A specific type of completion queue used by the processing of notifications by servers.
Definition: completion_queue_impl.h:390
A builder class for the creation and startup of grpc::Server instances.
Definition: server_builder_impl.h:86
virtual ~GlobalCallbacks()
Definition: server_impl.h:82
grpc_server * server() override
Definition: server_impl.h:206
Definition: server_initializer_impl.h:34
Straightforward wrapping of the C call object.
Definition: call.h:38