#include <server.h>
Classes | |
class | AllocatingRequestMatcherBase |
class | AllocatingRequestMatcherBatch |
class | AllocatingRequestMatcherRegistered |
class | CallbackRequest |
class | experimental_type |
class | GlobalCallbacks |
class | RealRequestMatcher |
struct | RegisteredMethod |
struct | RequestedCall |
class | RequestMatcherInterface |
class | SyncRequest |
class | SyncRequestThreadManager |
class | UnimplementedAsyncRequest |
class | UnimplementedAsyncResponse |
Public Member Functions | |
def | add_generic_rpc_handlers (self, generic_rpc_handlers) |
def | add_insecure_port (self, address) |
def | add_secure_port (self, address, server_credentials) |
grpc_server * | c_server () |
experimental_type | experimental () |
HealthCheckServiceInterface * | GetHealthCheckService () const |
Returns the health check service. More... | |
std::shared_ptr< Channel > | InProcessChannel (const ChannelArguments &args) |
Establish a channel for in-process communication. More... | |
def | start (self) |
def | stop (self, grace) |
void | Wait () ABSL_LOCKS_EXCLUDED(mu_) override |
def | wait_for_termination (self, timeout=None) |
~Server () ABSL_LOCKS_EXCLUDED(mu_) override | |
![]() | |
void | Shutdown () |
template<class T > | |
void | Shutdown (const T &deadline) |
~ServerInterface () override | |
![]() | |
virtual | ~CallHook () |
Static Public Member Functions | |
static void | SetGlobalCallbacks (GlobalCallbacks *callbacks) |
Friends | |
class | AsyncGenericService |
class | ServerBuilder |
class | ServerInitializer |
Represents a gRPC server.
Use a grpc::ServerBuilder to create, configure, and start Server instances.
Services RPCs.
Definition at line 59 of file include/grpcpp/server.h.
|
override |
Definition at line 952 of file server_cc.cc.
|
protected |
NOTE: This is NOT a public API. The server constructors are supposed to be used by ServerBuilder class only. The constructor will be made 'private' very soon.
Server constructors. To be used by ServerBuilder only.
args | The channel args |
sync_server_cqs | The completion queues to use if the server is a synchronous server (or a hybrid server). The server polls for new RPCs on these queues |
min_pollers | The minimum number of polling threads per server completion queue (in param sync_server_cqs) to use for listening to incoming requests (used only in case of sync server) |
max_pollers | The maximum number of polling threads per server completion queue (in param sync_server_cqs) to use for listening to incoming requests (used only in case of sync server) |
sync_cq_timeout_msec | The timeout to use when calling AsyncNext() on server completion queues passed via sync_server_cqs param. |
def grpc.Server.add_generic_rpc_handlers | ( | self, | |
generic_rpc_handlers | |||
) |
Registers GenericRpcHandlers with this Server. This method is only safe to call before the server is started. Args: generic_rpc_handlers: An iterable of GenericRpcHandlers that will be used to service RPCs.
Reimplemented in grpc._server._Server.
Definition at line 1402 of file src/python/grpcio/grpc/__init__.py.
def grpc.Server.add_insecure_port | ( | self, | |
address | |||
) |
Opens an insecure port for accepting RPCs. This method may only be called before starting the server. Args: address: The address for which to open a port. If the port is 0, or not specified in the address, then gRPC runtime will choose a port. Returns: An integer port on which server will accept RPC requests.
Reimplemented in grpc._server._Server.
Definition at line 1414 of file src/python/grpcio/grpc/__init__.py.
def grpc.Server.add_secure_port | ( | self, | |
address, | |||
server_credentials | |||
) |
Opens a secure port for accepting RPCs. This method may only be called before starting the server. Args: address: The address for which to open a port. if the port is 0, or not specified in the address, then gRPC runtime will choose a port. server_credentials: A ServerCredentials object. Returns: An integer port on which server will accept RPC requests.
Reimplemented in grpc._server._Server.
Definition at line 1429 of file src/python/grpcio/grpc/__init__.py.
|
overrideprotectedvirtual |
Try binding the server to the given addr endpoint (port, and optionally including IP address to bind to).
It can be invoked multiple times. Should be used before starting the server.
addr | The address to try to bind to the server (eg, localhost:1234, 192.168.1.1:31416, [::1]:27182, etc.). |
creds | The credentials associated with the server. |
Implements grpc::ServerInterface.
Definition at line 1110 of file server_cc.cc.
grpc_server * grpc::Server::c_server | ( | ) |
Returns a raw pointer to the underlying grpc_server instance. EXPERIMENTAL: for internal/test use only
Definition at line 989 of file server_cc.cc.
|
overrideprivatevirtual |
Reimplemented from grpc::ServerInterface.
Definition at line 1366 of file server_cc.cc.
|
inlineprotected |
Definition at line 206 of file include/grpcpp/server.h.
|
inline |
NOTE: The function experimental() is not stable public API. It is a view to the experimental components of this class. It may be changed or removed at any time.
Definition at line 131 of file include/grpcpp/server.h.
|
inline |
Returns the health check service.
Definition at line 102 of file include/grpcpp/server.h.
|
inlineprotected |
NOTE: This method is not part of the public API for this class.
Definition at line 209 of file include/grpcpp/server.h.
|
private |
Definition at line 1362 of file server_cc.cc.
std::shared_ptr< grpc::Channel > grpc::Server::InProcessChannel | ( | const ChannelArguments & | args | ) |
Establish a channel for in-process communication.
Definition at line 991 of file server_cc.cc.
|
inlineoverrideprivatevirtual |
Reimplemented from grpc::ServerInterface.
Definition at line 215 of file include/grpcpp/server.h.
|
inlineoverrideprivatevirtual |
Implements grpc::ServerInterface.
Definition at line 256 of file include/grpcpp/server.h.
|
overrideprivatevirtual |
Implements grpc::ServerInterface.
Definition at line 1330 of file server_cc.cc.
|
private |
Definition at line 1118 of file server_cc.cc.
|
overrideprivatevirtual |
Register a generic service. This call does not take ownership of the service. The service must exist for the lifetime of the Server instance.
Implements grpc::ServerInterface.
Definition at line 1085 of file server_cc.cc.
|
overrideprivatevirtual |
Register a callback-based generic service. This call does not take ownership of theservice. The service must exist for the lifetime of the Server instance.
Reimplemented from grpc::ServerInterface.
Definition at line 1092 of file server_cc.cc.
|
inlineprivate |
Definition at line 245 of file include/grpcpp/server.h.
|
overrideprotectedvirtual |
Register a service. This call does not take ownership of the service. The service must exist for the lifetime of the Server instance.
Implements grpc::ServerInterface.
Definition at line 1026 of file server_cc.cc.
|
inlineoverrideprotectedvirtual |
Implements grpc::ServerInterface.
Definition at line 197 of file include/grpcpp/server.h.
|
inlineprotected |
NOTE: This method is not part of the public API for this class.
Definition at line 201 of file include/grpcpp/server.h.
|
static |
Set the global callback object. Can only be called once per application. Does not take ownership of callbacks, and expects the pointed to object to be alive until all server objects in the process have been destroyed. The same GlobalCallbacks object will be used throughout the application and is shared among all Server objects.
Definition at line 983 of file server_cc.cc.
|
overrideprivatevirtual |
The completion queue to use for server shutdown completion notification
Implements grpc::ServerInterface.
Definition at line 1245 of file server_cc.cc.
def grpc.Server.start | ( | self | ) |
Starts this Server. This method may only be called once. (i.e. it is not idempotent).
Reimplemented in grpc._server._Server.
Definition at line 1446 of file src/python/grpcio/grpc/__init__.py.
|
overrideprotectedvirtual |
Start the server.
cqs | Completion queues for handling asynchronous services. The caller is required to keep all completion queues live until the server is destroyed. |
num_cqs | How many completion queues does cqs hold. |
Implements grpc::ServerInterface.
Definition at line 1145 of file server_cc.cc.
def grpc.Server.stop | ( | self, | |
grace | |||
) |
Stops this Server. This method immediately stop service of new RPCs in all cases. If a grace period is specified, this method returns immediately and all RPCs active at the end of the grace period are aborted. If a grace period is not specified (by passing None for `grace`), all existing RPCs are aborted immediately and this method blocks until the last RPC handler terminates. This method is idempotent and may be called at any time. Passing a smaller grace value in a subsequent call will have the effect of stopping the Server sooner (passing None will have the effect of stopping the server immediately). Passing a larger grace value in a subsequent call *will not* have the effect of stopping the server later (i.e. the most restrictive grace value is used). Args: grace: A duration of time in seconds or None. Returns: A threading.Event that will be set when this Server has completely stopped, i.e. when running RPCs either complete or are aborted and all handlers have terminated.
Reimplemented in grpc._server._Server.
Definition at line 1454 of file src/python/grpcio/grpc/__init__.py.
|
private |
Definition at line 1134 of file server_cc.cc.
|
private |
Definition at line 1122 of file server_cc.cc.
|
overridevirtual |
Block until the server shuts down.
Implements grpc::ServerInterface.
Definition at line 1323 of file server_cc.cc.
def grpc.Server.wait_for_termination | ( | self, | |
timeout = None |
|||
) |
Block current thread until the server stops. This is an EXPERIMENTAL API. The wait will not consume computational resources during blocking, and it will block until one of the two following conditions are met: 1) The server is stopped or terminated; 2) A timeout occurs if timeout is not `None`. The timeout argument works in the same way as `threading.Event.wait()`. https://docs.python.org/3/library/threading.html#threading.Event.wait Args: timeout: A floating point number specifying a timeout for the operation in seconds. Returns: A bool indicates if the operation times out.
Reimplemented in grpc._server._Server.
Definition at line 1483 of file src/python/grpcio/grpc/__init__.py.
|
friend |
Definition at line 219 of file include/grpcpp/server.h.
|
friend |
Definition at line 220 of file include/grpcpp/server.h.
|
friend |
Definition at line 221 of file include/grpcpp/server.h.
|
private |
Definition at line 272 of file include/grpcpp/server.h.
|
private |
Definition at line 337 of file include/grpcpp/server.h.
|
private |
Definition at line 318 of file include/grpcpp/server.h.
|
private |
Definition at line 342 of file include/grpcpp/server.h.
|
private |
Definition at line 331 of file include/grpcpp/server.h.
|
private |
Definition at line 306 of file include/grpcpp/server.h.
Definition at line 309 of file include/grpcpp/server.h.
Definition at line 310 of file include/grpcpp/server.h.
Definition at line 311 of file include/grpcpp/server.h.
|
private |
Definition at line 320 of file include/grpcpp/server.h.
|
private |
Definition at line 321 of file include/grpcpp/server.h.
|
private |
Definition at line 280 of file include/grpcpp/server.h.
|
private |
Definition at line 282 of file include/grpcpp/server.h.
|
private |
Definition at line 295 of file include/grpcpp/server.h.
|
private |
Definition at line 328 of file include/grpcpp/server.h.
|
private |
Definition at line 314 of file include/grpcpp/server.h.
|
private |
Definition at line 316 of file include/grpcpp/server.h.
|
private |
Definition at line 308 of file include/grpcpp/server.h.
|
private |
Definition at line 304 of file include/grpcpp/server.h.
|
private |
Definition at line 300 of file include/grpcpp/server.h.
|
private |
Definition at line 302 of file include/grpcpp/server.h.
|
private |
Definition at line 296 of file include/grpcpp/server.h.
|
private |
List of ThreadManager instances (one for each cq in the sync_server_cqs)
Definition at line 292 of file include/grpcpp/server.h.
|
private |
The following completion queues are ONLY used in case of Sync API i.e. if the server has any services with sync methods. The server uses these completion queues to poll for new RPCs
Definition at line 288 of file include/grpcpp/server.h.
|
private |
Definition at line 325 of file include/grpcpp/server.h.