class documentation

class ClientChannelInterface(Protocol): (source)

Known subclasses: nebius.aio.constant_channel.Constant

View In Hierarchy

Protocol describing the minimal channel operations required by SDK clients.

Typical implementations are nebius.aio.channel.Channel or simple test doubles that provide access to transport channels and authorization providers. The built-in channel additionally exposes run_async. It schedules work immediately and returns a reusable cross-loop awaitable. That capability remains optional so existing custom channels which implement this minimal protocol keep their local-awaitable compatibility path.

Method discard_channel Discard an AddressChannel.
Method get_authorization_provider Get the configured AuthorizationProvider or None.
Method get_channel_by_method Obtain an AddressChannel for the specified RPC method.
Method parent_id Get the default parent id applied to some requests.
Method return_channel Return an AddressChannel to the channel pool for reuse.
Method run_sync Run an awaitable synchronously using the channel's configured event loop.
def discard_channel(self, chan: AddressChannel | None): (source)

Discard an AddressChannel.

The underlying transport is closed and not reused.

def get_authorization_provider(self) -> AuthorizationProvider | None: (source)

Get the configured AuthorizationProvider or None.

def get_channel_by_method(self, method_name: str) -> AddressChannel: (source)

Obtain an AddressChannel for the specified RPC method.

Parameters
method_name:strFully-qualified RPC method name ('/pkg.Service/Method').
Returns
AddressChannelAn AddressChannel for the resolved address.
def parent_id(self) -> str | None: (source)

Get the default parent id applied to some requests.

Return None if no parent id was configured.

def return_channel(self, chan: AddressChannel | None): (source)

Return an AddressChannel to the channel pool for reuse.

def run_sync(self, awaitable: Awaitable[T], timeout: float | None = None) -> T: (source)

Run an awaitable synchronously using the channel's configured event loop.

Return the result after the awaitable completes.