userver: ugrpc::server::ServerComponent Class Reference
Loading...
Searching...
No Matches
ugrpc::server::ServerComponent Class Referencefinal

#include <userver/ugrpc/server/server_component.hpp>

Detailed Description

Component that configures and manages the gRPC server.

Static options of ugrpc::server::ServerComponent :

Name Description Default value
port The port to use for all gRPC services, or 0 to pick any available. –
unix-socket-path Unix socket absolute path. –
use-callback-api Use the gRPC callback/reactor API for server RPCs instead of completion queues. false
event-engine Settings of the userver EventEngine of this server. –
event-engine.enabled Run the socket I/O and timers of this server on a userver task processor (userver EventEngine) instead of gRPC's own threads. Enabling it changes gRPC settings for the whole process, including other gRPC servers and clients. Requires use-callback-api. Not available in CMake builds yet. false
event-engine.task-processor Task processor for the userver EventEngine. Has no effect unless the engine is enabled. –
completion-queue-count Number of server completion queues. With use-callback-api enabled, these queues are created only when no services are registered; client queues are configured through grpc-client-common.completion-queue-count. 2
channel-args.* A map of channel arguments, see gRPC Core docs. Each of the elements: value of channel argument, must be string or integer. {}
native-log-level Min log level for the native gRPC library. Possible values: trace, debug, info, warning, error, critical, none. error
enable-channelz Enable channelz. false
tls TLS settings. –
tls.ca Path to TLS client CA certificate. –
tls.key Path to TLS certificate key. –
tls.cert Path to TLS certificate. –
service-defaults Omitted options for service components will default to the corresponding option from here. –
service-defaults.task-processor The task processor to use for responses. –
service-defaults.always-log-call-spans Default value of always-log-call-spans for gRPC service components. false
service-defaults.use-protobuf-arena Allocate typed requests and proto-struct responses on protobuf arenas. false

Options inherited from components::ComponentBase :

Name Description Default value
load-enabled Set to false to disable loading of the component. true

The component name for static config is "grpc-server".

See also
https://grpc.github.io/grpc/core/group__grpc__arg__keys.html

Definition at line 31 of file server_component.hpp.

Inheritance diagram for ugrpc::server::ServerComponent:

Public Member Functions

 ServerComponent (const components::ComponentConfig &config, const components::ComponentContext &context)
Server & GetServer () noexcept
ComponentHealth GetComponentHealth () const override
void OnLoadingCancelled () override

Static Public Member Functions

static yaml_config::Schema GetStaticConfigSchema ()

Static Public Attributes

static constexpr std::string_view kName = "grpc-server"
 The default name of ugrpc::server::ServerComponent.

Protected Types

using LoggableComponentBase = ComponentBase

Member Typedef Documentation

◆ LoggableComponentBase

using components::ComponentBase::LoggableComponentBase = ComponentBase
protectedinherited
Deprecated
use components::ComponentBase instead.

Definition at line 79 of file component_base.hpp.

Member Function Documentation

◆ GetComponentHealth()

ComponentHealth components::ComponentBase::GetComponentHealth ( ) const
inlineoverridevirtualinherited

Override this function to inform the world of the state of your component.

Warning
The function is called concurrently from multiple threads.

Reimplemented from components::RawComponentBase.

Reimplemented in components::Redis, and server::handlers::Restart.

Definition at line 35 of file component_base.hpp.

◆ GetServer()

Server & ugrpc::server::ServerComponent::GetServer ( )
noexcept
Returns
The contained Server instance
Note
All configuration must be performed at the components loading stage

◆ OnLoadingCancelled()

void components::ComponentBase::OnLoadingCancelled ( )
inlineoverridevirtualinherited

Called once if the creation of any other component failed. If the current component expects some other component to take any action with the current component, this call is a signal that such action may never happen due to components loading was cancelled. Application components might not want to override it.

Reimplemented from components::RawComponentBase.

Definition at line 42 of file component_base.hpp.


The documentation for this class was generated from the following file: