Utilities for handling gRPC channel options specific to Nebius SDK.
This module provides functions to extract and validate options from gRPC channel arguments, as well as constants for common Nebius-specific options.
The options are used to configure various aspects of the gRPC channels, such as security settings and compression.
| Exception | |
Exception raised when an option has an unexpected type. |
| Function | pop |
Extract the last occurrence of a named option from channel arguments. |
| Function | pop |
Extract all occurrences of a named option from channel arguments. |
| Constant | COMPRESSION |
Option name for compression settings |
| Constant | INSECURE |
Option name for insecure channel configuration |
| Type Variable | T |
Undocumented |
ChannelArgumentType, name: str, expected_type: type[ T]) -> tuple[ ChannelArgumentType, T | None]:
(source)
¶
Extract the last occurrence of a named option from channel arguments.
This function searches for options with the given name in the channel arguments, validates their type, and returns the remaining arguments along with the last matching option value (or None if not found).
| Parameters | |
args:ChannelArgumentType | The channel arguments to search. |
name:str | The name of the option to extract. |
expectedtype[ | The expected type of the option value. |
| Returns | |
tuple[ | A tuple of (remaining_args, option_value), where option_value is the last matching value or None. |
| Raises | |
WrongTypeError | If an option with the name has a wrong type. |
ChannelArgumentType, name: str, expected_type: type[ T]) -> tuple[ ChannelArgumentType, Sequence[ T]]:
(source)
¶
Extract all occurrences of a named option from channel arguments.
This function searches for all options with the given name in the channel arguments, validates their types, and returns the remaining arguments along with a sequence of matching option values.
| Parameters | |
args:ChannelArgumentType | The channel arguments to search. |
name:str | The name of the option to extract. |
expectedtype[ | The expected type of the option values. |
| Returns | |
tuple[ | A tuple of (remaining_args, option_values), where option_values is a sequence of matching values. |
| Raises | |
WrongTypeError | If any option with the name has a wrong type. |