Go to the documentation of this file.
19 #ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
20 #define GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
36 class AsyncGenericService;
38 class CompletionQueue;
39 class GenericServerContext;
40 class ServerCompletionQueue;
41 class ServerCredentials;
50 class ServerAsyncStreamingInterface;
53 #ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
54 namespace experimental {
56 class CallbackGenericService;
57 #ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
61 namespace experimental {
62 class ServerInterceptorFactoryInterface;
120 virtual void Wait() = 0;
123 friend class ::grpc::Service;
133 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
138 virtual void RegisterCallbackGenericService(CallbackGenericService*
141 class experimental_registration_interface {
151 std::unique_ptr<ContextAllocator> context_allocator) {}
200 bool delete_on_finalize);
206 void ContinueFinalizeResultAfterInterception();
230 void* tag,
const char* name,
241 *
server_->interceptor_creators()));
262 server, context, stream, call_cq, notification_cq, tag,
263 registered_method->name(), registered_method->method_type()) {
270 template <
class Message>
280 server, context, stream, call_cq, notification_cq, tag,
281 registered_method->name(), registered_method->method_type()),
282 registered_method_(registered_method),
299 payload_.bbuf_ptr(), request_)
334 void* tag,
bool delete_on_finalize);
342 template <
class Message>
351 notification_cq, tag, message);
362 notification_cq, tag);
381 std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>*
382 interceptor_creators() {
394 virtual ::grpc::CompletionQueue* CallbackCQ() {
return nullptr; }
399 #endif // GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
Definition: server_interface.h:194
void RequestAsyncCall(internal::RpcServiceMethod *method, ::grpc::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc::CompletionQueue *call_cq, ::grpc::ServerCompletionQueue *notification_cq, void *tag, Message *message)
Definition: server_interface.h:343
RegisteredAsyncRequest is not part of the C++ API.
Definition: server_interface.h:223
Definition: service_type.h:37
bool done_intercepting_
Definition: server_interface.h:219
@ GRPC_STATUS_INTERNAL
Internal errors.
Definition: status.h:127
A ServerContext or CallbackServerContext allows the code implementing a service handler to:
Definition: server_context.h:546
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
virtual experimental_registration_interface * experimental_registration()
NOTE: The function experimental_registration() is not stable public API.
Definition: server_interface.h:158
~ServerInterface() override
Definition: server_interface.h:67
void Shutdown()
Shutdown the server without a deadline and forced cancellation.
Definition: server_interface.h:111
This is an interface that Channel and Server implement to allow them to hook performing ops.
Definition: call_hook.h:30
Definition: grpc_types.h:554
::grpc::CompletionQueue *const call_cq_
Definition: server_interface.h:212
const char * name_
Definition: server_interface.h:248
Wrapper around grpc_server_credentials, a way to authenticate a server.
Definition: server_credentials.h:70
~PayloadAsyncRequest() override
Definition: server_interface.h:288
Straightforward wrapping of the C call object.
Definition: call.h:35
virtual void Start(::grpc::ServerCompletionQueue **cqs, size_t num_cqs)=0
Start the server.
Definition: server_interface.h:271
virtual void ShutdownInternal(gpr_timespec deadline)=0
Desriptor of an RPC service and its various RPC methods.
Definition: service_type.h:56
virtual bool RegisterService(const std::string *host, Service *service)=0
Register a service.
virtual grpc_call_error grpc_call_cancel_with_status(grpc_call *call, grpc_status_code status, const char *description, void *reserved)=0
~BaseAsyncRequest() override
void *const tag_
Definition: server_interface.h:214
virtual gpr_timespec gpr_inf_future(gpr_clock_type type)=0
internal::Call call_wrapper_
Definition: server_interface.h:217
virtual ~experimental_registration_interface()
Definition: server_interface.h:146
bool FinalizeResult(void **tag, bool *status) override
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
virtual void RegisterContextAllocator(std::unique_ptr< ContextAllocator > context_allocator)
Definition: server_interface.h:150
bool FinalizeResult(void **tag, bool *status) override
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
PayloadAsyncRequest(internal::RpcServiceMethod *registered_method, ServerInterface *server, ::grpc::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc::CompletionQueue *call_cq, ::grpc::ServerCompletionQueue *notification_cq, void *tag, Message *request)
Definition: server_interface.h:273
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:70
Definition: grpc_types.h:40
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
A sequence of bytes.
Definition: byte_buffer.h:61
NOTE: class experimental_registration_interface is not part of the public API of this class TODO(vjpa...
Definition: server_interface.h:144
const bool delete_on_finalize_
Definition: server_interface.h:215
virtual void RegisterAsyncGenericService(AsyncGenericService *service)=0
Register a generic service.
virtual grpc_server * server()=0
void RequestAsyncCall(internal::RpcServiceMethod *method, ::grpc::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc::CompletionQueue *call_cq, ::grpc::ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:354
virtual int max_receive_message_size() const =0
void PerformOpsOnCall(internal::CallOpSetInterface *ops, internal::Call *call) override=0
@ GPR_CLOCK_MONOTONIC
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: server_interface.h:252
void Shutdown(const T &deadline)
Shutdown does the following things:
Definition: server_interface.h:102
Defines how to serialize and deserialize some type.
Definition: serialization_traits.h:58
grpc_call * call_
Definition: server_interface.h:216
CallbackGenericService is the base class for generic services implemented using the callback API and ...
Definition: async_generic_service.h:106
Definition: async_generic_service.h:68
RegisteredAsyncRequest(ServerInterface *server, ::grpc::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc::CompletionQueue *call_cq, ::grpc::ServerCompletionQueue *notification_cq, void *tag, const char *name, internal::RpcMethod::RpcType type)
ServerInterface *const server_
Definition: server_interface.h:209
void * server_tag() const
Definition: rpc_service_method.h:103
RpcType
Definition: rpc_method.h:31
Definition: async_generic_service.h:39
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
void SetRecvMessage(void *message, bool *hijacked_recv_message_failed)
Definition: interceptor_common.h:168
virtual void grpc_call_unref(grpc_call *call)=0
const internal::RpcMethod::RpcType type_
Definition: server_interface.h:249
GenericAsyncRequest(ServerInterface *server, GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc::CompletionQueue *call_cq, ::grpc::ServerCompletionQueue *notification_cq, void *tag, bool delete_on_finalize)
virtual void RegisterCallbackGenericService(experimental::CallbackGenericService *)
May not be abstract since this is a post-1.0 API addition.
Definition: server_interface.h:148
void RequestAsyncGenericCall(GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc::CompletionQueue *call_cq, ::grpc::ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:365
virtual int AddListeningPort(const std::string &addr, ServerCredentials *creds)=0
Tries to bind server to the given addr.
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:233
void IssueRequest(void *registered_method, grpc_byte_buffer **payload, ::grpc::ServerCompletionQueue *notification_cq)
BaseAsyncRequest(ServerInterface *server, ::grpc::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc::CompletionQueue *call_cq, ::grpc::ServerCompletionQueue *notification_cq, void *tag, bool delete_on_finalize)
A specific type of completion queue used by the processing of notifications by servers.
Definition: completion_queue.h:426
::grpc::ServerContext *const context_
Definition: server_interface.h:210
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue.h:102
Definition: server_interface.h:328
bool Valid() const
Is this ByteBuffer valid?
Definition: byte_buffer.h:157
internal::ServerAsyncStreamingInterface *const stream_
Definition: server_interface.h:211
CoreCodegenInterface * g_core_codegen_interface
Definition: completion_queue.h:96
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:146
Server side rpc method class.
Definition: rpc_service_method.h:84
NoPayloadAsyncRequest(internal::RpcServiceMethod *registered_method, ServerInterface *server, ::grpc::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc::CompletionQueue *call_cq, ::grpc::ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:254
void Release()
Forget underlying byte buffer without destroying Use this only for un-owned byte buffers.
Definition: byte_buffer.h:140
Definition: server_interface.h:65
Analogous to struct timespec.
Definition: gpr_types.h:47
::google::protobuf::Message Message
Definition: config_protobuf.h:76
virtual void Wait()=0
Block waiting for all work to complete.
internal::InterceptorBatchMethodsImpl interceptor_methods_
Definition: server_interface.h:218
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:292
Definition: interceptor_common.h:36
If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec ...
Definition: time.h:40
void AddInterceptionHookPoint(experimental::InterceptionHookPoints type)
Definition: interceptor_common.h:78
::grpc::ServerCompletionQueue *const notification_cq_
Definition: server_interface.h:213