module documentation

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 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.

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: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.

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: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')