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 WrongTypeError Exception raised when an option has an unexpected type.
Function pop_option Extract the last occurrence of a named option from channel arguments.
Function pop_options 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:ChannelArgumentTypeThe channel arguments to search.
name:strThe name of the option to extract.
expected_type:type[T]The expected type of the option value.
Returns
tuple[ChannelArgumentType, T | None]A tuple of (remaining_args, option_value), where option_value is the last matching value or None.
Raises
WrongTypeErrorIf 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:ChannelArgumentTypeThe channel arguments to search.
name:strThe name of the option to extract.
expected_type:type[T]The expected type of the option values.
Returns
tuple[ChannelArgumentType, Sequence[T]]A tuple of (remaining_args, option_values), where option_values is a sequence of matching values.
Raises
WrongTypeErrorIf any option with the name has a wrong type.
COMPRESSION: str = (source)

Option name for compression settings

Value
'nebius.compression'
INSECURE: str = (source)

Option name for insecure channel configuration

Value
'nebius.insecure'

Undocumented

Value
TypeVar('T')