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();
187 if (done_intercepting_) {
188 return BaseAsyncRequest::FinalizeResult(tag, status);
191 call_, server_, call_cq_, server_->max_receive_message_size(),
192 context_->set_server_rpc_info(name_,
193 *server_->interceptor_creators()));
194 return BaseAsyncRequest::FinalizeResult(tag, status);
211 notification_cq, tag,
212 registered_method->name()) {
213 IssueRequest(registered_method->
server_tag(),
nullptr, notification_cq);
219 template <
class Message>
229 notification_cq, tag,
230 registered_method->name()),
231 registered_method_(registered_method),
236 notification_cq_(notification_cq),
239 IssueRequest(registered_method->
server_tag(), payload_.bbuf_ptr(),
249 if (done_intercepting_) {
250 return RegisteredAsyncRequest::FinalizeResult(tag, status);
254 payload_.bbuf_ptr(), request_)
260 g_core_codegen_interface->grpc_call_cancel_with_status(
262 g_core_codegen_interface->grpc_call_unref(call_);
264 stream_, call_cq_, notification_cq_, tag_,
271 interceptor_methods_.AddInterceptionHookPoint(
273 interceptor_methods_.SetRecvMessage(request_);
274 return RegisteredAsyncRequest::FinalizeResult(tag, status);
296 bool delete_on_finalize);
298 bool FinalizeResult(
void** tag,
bool* status)
override;
304 template <
class Message>
313 notification_cq, tag, message);
323 notification_cq, tag);
342 std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>*
343 interceptor_creators() {
360 #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:203
void RequestAsyncGenericCall(GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:326
#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
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:220
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
Definition: server_interface.h:177
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:305
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:486
Definition: grpc_types.h:40
Definition: async_generic_service.h:65
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:222
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
An Alarm posts the user provided tag to its associated completion queue upon expiry or cancellation...
Definition: alarm.h:33
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:316
Definition: interceptor_common.h:36
A ServerContext allows the person implementing a service handler to:
Definition: server_context.h:102
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:200
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:247
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:243
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:290
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:374
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:205
A sequence of bytes.
Definition: byte_buffer.h:62
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:185
Straightforward wrapping of the C call object.
Definition: call.h:36
::google::protobuf::Message Message
Definition: config_protobuf.h:78