Skip to content

RpcClient

Defined in: src/client/connect.ts:54

A connected RPC client, returned by httpConnect, pipeConnect, and subprocessConnect.

call(method, params?): Promise<Record<string, any> | null>;

Defined in: src/client/connect.ts:56

Invoke a unary method. Returns the single result row, or null for void methods. Parameter defaults from the server’s description are applied automatically.

Parameter Type
method string
params? Record<string, any>

Promise<Record<string, any> | null>


callRaw(method, input): Promise<RawBatch | null>;

Defined in: src/client/connect.ts:72

Invoke a unary method from an already-encoded request batch.

The batch-level twin of RpcClient.call, for a caller that holds encoded Arrow rather than values: input crosses verbatim (schema, buffers and custom metadata alike), and the reply comes back as the server encoded it. Resolves to null when the method returns nothing.

input.metadata is the call’s dispatch metadata and must already carry vgi_rpc.method and vgi_rpc.protocol; nothing here supplies a default for either. Unlike RpcClient.call this applies no parameter defaults and needs no introspection round trip.

Parameter Type
method string
input RawBatch

Promise<RawBatch | null>


close(): void;

Defined in: src/client/connect.ts:88

Release transport resources; for subprocess clients this also terminates the child process.

void


describe(): Promise<ServiceDescription>;

Defined in: src/client/connect.ts:86

Fetch the server’s method/protocol description (cached after the first call).

Promise<ServiceDescription>


stream(method, params?): Promise<StreamSession>;

Defined in: src/client/connect.ts:58

Open a streaming method, returning a StreamSession for exchange or producer iteration.

Parameter Type
method string
params? Record<string, any>

Promise<StreamSession>


streamRaw(
method,
input,
options
): Promise<RawStreamSession>;

Defined in: src/client/connect.ts:80

Open a streaming method from an already-encoded request batch.

options.isExchange and options.hasHeader come from the method’s declaration — this is the batch-level path, so there is no description to read them from and no name-shaped guess worth making.

Parameter Type
method string
input RawBatch
options { hasHeader: boolean; isExchange: boolean; }
options.hasHeader boolean
options.isExchange boolean

Promise<RawStreamSession>