module documentation
Handle Nebius SDK options for gRPC channels.
This module supplies functions that extract and validate options from gRPC channel arguments. It also supplies constants for common Nebius options.
The options configure channel security 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 |
def pop_option(args:
ChannelArgumentType, name: str, expected_type: type[ T]) -> tuple[ ChannelArgumentType, T | None]:
(source)
¶
Extract the last occurrence of a named option from channel arguments.
Search the channel arguments for the name and validate matching values. Return the remaining arguments and the last match. Return None if there is no match.
| 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. |
def pop_options(args:
ChannelArgumentType, name: str, expected_type: type[ T]) -> tuple[ ChannelArgumentType, Sequence[ T]]:
(source)
¶
Extract all occurrences of a named option from channel arguments.
Search the channel arguments for the name and validate matching values. Return the remaining arguments and all matches.
| 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. |