Skip to content

Base

pyvider.rpcplugin.protocol.base

Base Definitions for RPC Plugin Protocols.

This module provides the abstract base class RPCPluginProtocol which defines the interface for protocol implementations used within the Pyvider RPC Plugin system.

Classes

RPCPluginProtocol

Bases: ABC, Generic[ServerT, HandlerT]

Abstract base class for defining RPC protocols. ServerT: Type of gRPC server HandlerT: Type of handler implementation

Functions
add_to_server abstractmethod async
add_to_server(server: ServerT, handler: HandlerT) -> None

Adds the protocol implementation to the gRPC server.

Parameters:

Name Type Description Default
server ServerT

The gRPC async server instance.

required
handler HandlerT

The handler implementing the RPC methods for this protocol.

required
Source code in pyvider/rpcplugin/protocol/base.py
@abstractmethod
async def add_to_server(self, server: ServerT, handler: HandlerT) -> None:
    """
    Adds the protocol implementation to the gRPC server.

    Args:
        server: The gRPC async server instance.
        handler: The handler implementing the RPC methods for this protocol.
    """
    pass
get_grpc_descriptors abstractmethod async
get_grpc_descriptors() -> tuple[Any, str]

Returns the protobuf descriptor set and service name.

Source code in pyvider/rpcplugin/protocol/base.py
@abstractmethod
async def get_grpc_descriptors(self) -> tuple[Any, str]:
    """Returns the protobuf descriptor set and service name."""
    pass