The core module provides the server, connection, transport interface, error types, and convenience functions for defining and running RPC services.
Most users only need serve_pipe (testing) or connect (subprocess):
from vgi_rpc import serve_pipe, connect
# In-process (tests)
with serve_pipe(MyService, MyServiceImpl()) as proxy:
proxy.my_method(arg=42)
# Subprocess
with connect(MyService, ["python", "worker.py"]) as proxy:
proxy.my_method(arg=42)For more control, use RpcServer and RpcConnection directly.
::: vgi_rpc.rpc.RpcServer
::: vgi_rpc.rpc.RpcConnection
::: vgi_rpc.rpc.RpcTransport
::: vgi_rpc.rpc.RpcMethodInfo
::: vgi_rpc.rpc.MethodType
::: vgi_rpc.rpc.RpcError
::: vgi_rpc.rpc.VersionError
These exception classes carry a stable error_kind class attribute that
the wire serializer surfaces as the vgi_rpc.error_kind metadata key on
the EXCEPTION-level batch. Clients can pattern-match the kind instead of
substring-searching the error message.
::: vgi_rpc.rpc.MethodNotImplementedError
::: vgi_rpc.rpc.SessionLostError
::: vgi_rpc.rpc.ServerDrainingError
See also IPCError in the Serialization module.
::: vgi_rpc.rpc.CallStatistics
::: vgi_rpc.rpc.run_server
::: vgi_rpc.rpc.connect
::: vgi_rpc.rpc.serve_pipe
::: vgi_rpc.rpc.describe_rpc
::: vgi_rpc.metadata.REQUEST_VERSION