Public Member Functions | |
def | __del__ (self) |
def | __init__ (self, thread_pool, generic_handlers, interceptors, options, maximum_concurrent_rpcs, compression, xds) |
def | add_generic_rpc_handlers (self, generic_rpc_handlers) |
def | add_insecure_port (self, address) |
def | add_secure_port (self, address, server_credentials) |
def | start (self) |
def | stop (self, grace) |
def | wait_for_termination (self, timeout=None) |
![]() | |
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... | |
void | Wait () ABSL_LOCKS_EXCLUDED(mu_) override |
~Server () ABSL_LOCKS_EXCLUDED(mu_) override | |
![]() | |
void | Shutdown () |
template<class T > | |
void | Shutdown (const T &deadline) |
~ServerInterface () override | |
![]() | |
virtual | ~CallHook () |
Private Attributes | |
_state | |
Definition at line 952 of file grpc/_server.py.
def grpc._server._Server.__init__ | ( | self, | |
thread_pool, | |||
generic_handlers, | |||
interceptors, | |||
options, | |||
maximum_concurrent_rpcs, | |||
compression, | |||
xds | |||
) |
Definition at line 955 of file grpc/_server.py.
def grpc._server._Server.__del__ | ( | self | ) |
Definition at line 992 of file grpc/_server.py.
def grpc._server._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 from grpc::Server.
Definition at line 964 of file grpc/_server.py.
def grpc._server._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 from grpc::Server.
Definition at line 968 of file grpc/_server.py.
def grpc._server._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 from grpc::Server.
Definition at line 972 of file grpc/_server.py.
def grpc._server._Server.start | ( | self | ) |
Starts this Server. This method may only be called once. (i.e. it is not idempotent).
Reimplemented from grpc::Server.
Definition at line 978 of file grpc/_server.py.
def grpc._server._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 from grpc::Server.
Definition at line 989 of file grpc/_server.py.
def grpc._server._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 from grpc::Server.
Definition at line 981 of file grpc/_server.py.
|
private |
Definition at line 959 of file grpc/_server.py.