HttpRpcClient
Defined in: src/client/connect.ts:92
An HTTP-connected RPC client: RpcClient plus the HTTP-only continuation-resume surface.
Extends
Section titled “Extends”Methods
Section titled “Methods”beginSession()
Section titled “beginSession()”beginSession(token?): void;Defined in: src/client/connect.ts:140
Enter a sticky-session scope on this connection.
Every subsequent request carries VGI-Session-Accept: true (the
server-side opt-in), the session token once the server has minted one,
and any VGI-Echo-<name> headers the server asked to have echoed back —
which is how a session survives a load balancer that has no cookie to
work with. Pass token to resume a session the server already holds.
Scoped, not permanent: HttpRpcClient.endSession closes it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
token? |
string | null |
Returns
Section titled “Returns”void
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>
Inherited from
Section titled “Inherited from”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>
Inherited from
Section titled “Inherited from”capabilities()
Section titled “capabilities()”capabilities(): Promise<HttpServerCapabilities>;Defined in: src/client/connect.ts:126
Discover what this server advertises on OPTIONS {prefix}/health.
Returns
Section titled “Returns”Promise<HttpServerCapabilities>
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
Inherited from
Section titled “Inherited from”currentEchoHeaders()
Section titled “currentEchoHeaders()”currentEchoHeaders(): Record<string, string>;Defined in: src/client/connect.ts:147
The VGI-Echo-* values captured when the session opened, keyed by the
header name to replay them under. Empty when there are none.
Returns
Section titled “Returns”Record<string, string>
currentSessionToken()
Section titled “currentSessionToken()”currentSessionToken(): string | null;Defined in: src/client/connect.ts:142
The session token in flight, or null when no session is open.
Returns
Section titled “Returns”string | null
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>
Inherited from
Section titled “Inherited from”detachSession()
Section titled “detachSession()”detachSession(): string | null;Defined in: src/client/connect.ts:153
Hand the session token to the caller and stop tracking it, so HttpRpcClient.endSession leaves the server-side session alive for a later HttpRpcClient.beginSession to resume.
Returns
Section titled “Returns”string | null
endSession()
Section titled “endSession()”endSession(): Promise<void>;Defined in: src/client/connect.ts:158
Leave the sticky-session scope, closing the server-side session with a
best-effort DELETE {prefix}/__session__ unless it was detached.
Returns
Section titled “Returns”Promise<void>
requestUploadUrls()
Section titled “requestUploadUrls()”requestUploadUrls(count?): Promise<UploadUrlPair[]>;Defined in: src/client/connect.ts:128
Ask the server for count pre-signed upload/download URL pairs.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
count? |
number |
Returns
Section titled “Returns”Promise<UploadUrlPair[]>
resumeStream()
Section titled “resumeStream()”resumeStream( method, token, outputSchema?): Promise<HttpStreamSession>;Defined in: src/client/connect.ts:118
Resume a producer stream from a continuation token without re-binding.
A continuation request (POST /{method}/exchange carrying only the
STATE_KEY token) is fully self-describing: the server recovers the
producer state, schemas, and function identity from the signed token
alone, so no bind/init round-trip is needed. This is the cheap path for a
stateless relay that holds a per-batch token (see
HttpStreamSession.nextWithToken) and resumes on any
connection/node — unlike stream(...) which would produce and discard a
fresh first turn before seeking.
token is the opaque blob from HttpStreamSession.nextWithToken,
which packs both the cursor and the call token; the resuming node may
never have seen this stream’s /init, so it needs both.
The returned session is positioned at token; the first nextWithToken()
(or iteration) issues the continuation. outputSchema is unused on the
producer-continuation path (each response’s IPC stream carries its own
schema) and defaults to the empty schema.
Mirrors Python’s _HttpProxy.resume_stream.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
method |
string |
token |
string |
outputSchema? |
Schema<any> |
Returns
Section titled “Returns”Promise<HttpStreamSession>
stream()
Section titled “stream()”stream(method, params?): Promise<HttpStreamSession>;Defined in: src/client/connect.ts:94
Open a streaming method, returning an HttpStreamSession for exchange or producer iteration.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
method |
string |
params? |
Record<string, any> |
Returns
Section titled “Returns”Promise<HttpStreamSession>
Overrides
Section titled “Overrides”streamRaw()
Section titled “streamRaw()”streamRaw( method, input, options): Promise<HttpStreamSession>;Defined in: src/client/connect.ts:120
Open a streaming method from an already-encoded request batch.
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<HttpStreamSession>
