module documentation

Service descriptor utilities for gRPC services.

This module provides classes and functions to extract service names from gRPC stub classes and handle service method descriptors in the Nebius async SDK. It includes stub implementations that prevent actual calls and an extractor channel for introspecting service metadata.

Class ExtractorChannel A mock gRPC channel for extracting service names from stub classes.
Class ServiceStub Protocol for gRPC service stub classes.
Class StubSS Stub implementation for stream-stream gRPC methods.
Class StubSU Stub implementation for stream-unary gRPC methods.
Class StubUS Stub implementation for unary-stream gRPC methods.
Class StubUU Stub implementation for unary-unary gRPC methods.
Exception NoMethodsInServiceError Error raised when no methods are found in a service stub.
Exception NotATrueCallError Error raised when attempting to call a stub method that is not meant to be executed.
Function from_stub_class Extract the service name from a gRPC stub class.
Type Variable Req Undocumented
Type Variable Res Undocumented
def from_stub_class(stub: type[ServiceStub]) -> str: (source)

Extract the service name from a gRPC stub class.

Uses an ExtractorChannel to instantiate the stub and record method calls, then extracts the service name from the recorded method.

Parameters
stub:type[ServiceStub]The stub class to extract from.
Returns
strThe service name.

Undocumented

Value
TypeVar('Req',
        bound=Message)

Undocumented

Value
TypeVar('Res',
        bound=Message)