grpc_server_config
drunc.grpc_testing_tools.grpc_server_config
Classes
GrpcServerConfig(server_id, server_type, host, port, max_workers, log_file, server_options=None, client_options=None, **kwargs)
Configuration container for a gRPC server instance.
Encapsulates all parameters needed to start and manage a gRPC server, providing a consistent interface across different execution environments.
Initialise gRPC server configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server_id
|
str
|
Unique identifier for this server instance |
required |
server_type
|
ServerType
|
Type of server (MANAGER, ROOT_CONTROLLER, or CHILD_CONTROLLER) |
required |
host
|
str
|
Hostname or IP address where the server will run |
required |
port
|
int
|
TCP port for the server to bind to |
required |
max_workers
|
int
|
Maximum number of worker threads for the server |
required |
log_file
|
str
|
Path to log file for server output |
required |
server_options
|
List[Tuple[str, Any]]
|
gRPC server configuration options |
None
|
client_options
|
List[Tuple[str, Any]]
|
gRPC client configuration options (for servers that act as clients) |
None
|
**kwargs
|
Additional server-specific parameters (e.g., manager_port, root_port, child_name) |
{}
|
Source code in drunc/grpc_testing_tools/grpc_server_config.py
Functions
get_param(key, default=None)
Get an additional parameter value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Parameter name to retrieve |
required |
default
|
Any
|
Default value if parameter not found |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
Parameter value or default if not found |