GitHub

RpcClientProtocolService

API reference for RpcClientProtocolService.

Makes the RPC client protocols of the RPC-based Runners (Effect's Runners.RpcClientProtocol).

Attributes

AttributeTypeDescription
codec_forCodecFor

codec_for(schema): the codec for schema's values that every protocol from make shares (used when a local send simulates a remote one; encode caches compare it by identity).

Functions

__init__

__init__(make, codec_for) -> None
ParameterTypeDescription
makeCallable[[RunnerAddress], Effect[ClientProtocolService, Never, Scope]]
codec_forCodecFor
def __init__(
    self,
    make: Callable[[RunnerAddress], Effect[ClientProtocolService, Never, Scope]],
    codec_for: CodecFor,
) -> None:
    self._make = make
    self._codec_for = codec_for

make

make(address) -> Effect[ClientProtocolService, Never, Scope]

A client protocol connected to the runner at address, open until the Scope closes; never fails (connection errors surface through the protocol's calls).

ParameterTypeDescription
addressRunnerAddress

Returns Effect[ClientProtocolService, Never, Scope]

def make(self, address: RunnerAddress) -> Effect[ClientProtocolService, Never, Scope]:
    """A client protocol connected to the runner at ``address``, open
    until the ``Scope`` closes; never fails (connection errors surface
    through the protocol's calls)."""
    return self._make(address)