Caller-side transport: delivers caller frames towards the handler and surfaces response frames coming back.

interface RpcClientTransport {
    onResponse(
        callback: (
            frame: { id: string; ok: boolean; payload?: unknown },
        ) => void,
    ): void;
    send(
        frame:
            | { id: string; method: string; payload?: unknown; service: string }
            | { abort: true; id: string },
    ): void;
}

Methods

  • Register a response listener. Multiple listeners are allowed (one per client sharing the transport).

    Parameters

    • callback: (frame: { id: string; ok: boolean; payload?: unknown }) => void

    Returns void

  • Parameters

    • frame:
          | { id: string; method: string; payload?: unknown; service: string }
          | { abort: true; id: string }

    Returns void