RpcClient
Defined in: src/client/connect.ts:54
A connected RPC client, returned by httpConnect, pipeConnect, and subprocessConnect.
Extended by
Section titled “Extended by”Methods
Section titled “Methods”call()
Section titled “call()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
method |
string |
params? |
Record<string, any> |
Returns
Section titled “Returns”Promise<Record<string, any> | null>
callRaw()
Section titled “callRaw()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
method |
string |
input |
RawBatch |
Returns
Section titled “Returns”Promise<RawBatch | null>
close()
Section titled “close()”close(): void;Defined in: src/client/connect.ts:88
Release transport resources; for subprocess clients this also terminates the child process.
Returns
Section titled “Returns”void
describe()
Section titled “describe()”describe(): Promise<ServiceDescription>;Defined in: src/client/connect.ts:86
Fetch the server’s method/protocol description (cached after the first call).
Returns
Section titled “Returns”Promise<ServiceDescription>
stream()
Section titled “stream()”stream(method, params?): Promise<StreamSession>;Defined in: src/client/connect.ts:58
Open a streaming method, returning a StreamSession for exchange or producer iteration.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
method |
string |
params? |
Record<string, any> |
Returns
Section titled “Returns”Promise<StreamSession>
streamRaw()
Section titled “streamRaw()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
method |
string |
input |
RawBatch |
options |
{ hasHeader: boolean; isExchange: boolean; } |
options.hasHeader |
boolean |
options.isExchange |
boolean |
Returns
Section titled “Returns”Promise<RawStreamSession>
