19 #ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H 20 #define GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H 33 class AsyncGenericService;
35 class GenericServerContext;
36 class ServerCompletionQueue;
38 class ServerCredentials;
47 class ServerAsyncStreamingInterface;
105 virtual void Wait() = 0;
108 friend class ::grpc::Service;
140 virtual void ShutdownInternal(
gpr_timespec deadline) = 0;
142 virtual int max_receive_message_size()
const = 0;
155 bool delete_on_finalize);
158 bool FinalizeResult(
void** tag,
bool* status)
override;
161 void ContinueFinalizeResultAfterInterception();
188 if (done_intercepting_) {
189 return BaseAsyncRequest::FinalizeResult(tag, status);
192 call_, server_, call_cq_, server_->max_receive_message_size(),
193 context_->set_server_rpc_info(name_, type_,
194 *server_->interceptor_creators()));
195 return BaseAsyncRequest::FinalizeResult(tag, status);
213 server, context, stream, call_cq, notification_cq, tag,
214 registered_method->name(), registered_method->method_type()) {
215 IssueRequest(registered_method->
server_tag(),
nullptr, notification_cq);
221 template <
class Message>
231 server, context, stream, call_cq, notification_cq, tag,
232 registered_method->name(), registered_method->method_type()),
233 registered_method_(registered_method),
238 notification_cq_(notification_cq),
241 IssueRequest(registered_method->
server_tag(), payload_.bbuf_ptr(),
251 if (done_intercepting_) {
252 return RegisteredAsyncRequest::FinalizeResult(tag, status);
256 payload_.bbuf_ptr(), request_)
262 g_core_codegen_interface->grpc_call_cancel_with_status(
264 g_core_codegen_interface->grpc_call_unref(call_);
266 stream_, call_cq_, notification_cq_, tag_,
273 interceptor_methods_.AddInterceptionHookPoint(
275 interceptor_methods_.SetRecvMessage(request_,
nullptr);
276 return RegisteredAsyncRequest::FinalizeResult(tag, status);
298 bool delete_on_finalize);
300 bool FinalizeResult(
void** tag,
bool* status)
override;
306 template <
class Message>
315 notification_cq, tag, message);
325 notification_cq, tag);
344 std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>*
345 interceptor_creators() {
362 #endif // GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:70
virtual ~ServerInterface()
Definition: server_interface.h:52
Definition: server_interface.h:205
void RequestAsyncGenericCall(GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:328
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:141
void Shutdown()
Shutdown the server without a deadline and forced cancellation.
Definition: server_interface.h:96
std::string string
Definition: config.h:35
const internal::RpcMethod::RpcType type_
Definition: server_interface.h:202
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
void * server_tag() const
Definition: rpc_service_method.h:100
Definition: server_interface.h:222
ServerInterface *const server_
Definition: server_interface.h:164
ServerCompletionQueue *const notification_cq_
Definition: server_interface.h:168
Desriptor of an RPC service and its various RPC methods.
Definition: service_type.h:58
RegisteredAsyncRequest is not part of the C++ API.
Definition: server_interface.h:178
internal::InterceptorBatchMethodsImpl interceptor_methods_
Definition: server_interface.h:173
bool done_intercepting_
Definition: server_interface.h:174
void RequestAsyncCall(internal::RpcServiceMethod *method, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag, Message *message)
Definition: server_interface.h:307
Monotonic clock.
Definition: gpr_types.h:33
struct grpc_server grpc_server
A server listens to some port and responds to request calls.
Definition: grpc_types.h:65
Definition: service_type.h:39
Definition: grpc_types.h:498
Definition: grpc_types.h:40
Definition: async_generic_service.h:65
RpcType
Definition: rpc_method.h:31
If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec ...
Definition: time.h:40
Defines how to serialize and deserialize some type.
Definition: serialization_traits.h:58
internal::Call call_wrapper_
Definition: server_interface.h:172
PayloadAsyncRequest(internal::RpcServiceMethod *registered_method, ServerInterface *server, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag, Message *request)
Definition: server_interface.h:224
Wrapper around grpc_server_credentials, a way to authenticate a server.
Definition: server_credentials.h:35
internal::ServerAsyncStreamingInterface *const stream_
Definition: server_interface.h:166
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
const bool delete_on_finalize_
Definition: server_interface.h:170
Server side rpc method class.
Definition: rpc_service_method.h:81
CoreCodegenInterface * g_core_codegen_interface
Definition: call_op_set.h:50
void RequestAsyncCall(internal::RpcServiceMethod *method, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:318
Definition: interceptor_common.h:36
A ServerContext allows the person implementing a service handler to:
Definition: server_context.h:109
Definition: server_interface.h:50
grpc_call * call_
Definition: server_interface.h:171
CompletionQueue *const call_cq_
Definition: server_interface.h:167
const char * name_
Definition: server_interface.h:201
Definition: async_generic_service.h:35
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue.h:95
bool FinalizeResult(void **tag, bool *status) override
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
Definition: server_interface.h:249
void Shutdown(const T &deadline)
Shutdown does the following things:
Definition: server_interface.h:87
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
~PayloadAsyncRequest()
Definition: server_interface.h:245
ServerContext *const context_
Definition: server_interface.h:165
Internal errors.
Definition: status.h:127
Analogous to struct timespec.
Definition: gpr_types.h:47
Definition: server_interface.h:292
void *const tag_
Definition: server_interface.h:169
A specific type of completion queue used by the processing of notifications by servers.
Definition: completion_queue.h:373
This is an interface that Channel and Server implement to allow them to hook performing ops...
Definition: call_hook.h:30
NoPayloadAsyncRequest(internal::RpcServiceMethod *registered_method, ServerInterface *server, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:207
A sequence of bytes.
Definition: byte_buffer.h:64
Definition: server_interface.h:149
virtual bool FinalizeResult(void **tag, bool *status) override
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
Definition: server_interface.h:186
Straightforward wrapping of the C call object.
Definition: call.h:36
::google::protobuf::Message Message
Definition: config_protobuf.h:78