VgiRpcServer
Defined in: src/server.ts:47
RPC server that reads Arrow IPC requests from stdin and writes responses to stdout. Supports unary and streaming (producer/exchange) methods.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new VgiRpcServer(protocol, options?): VgiRpcServer;Defined in: src/server.ts:68
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
protocol |
Protocol |
- |
options? |
{ dispatchHook?: DispatchHook; enableDescribe?: boolean; externalLocation?: ExternalLocationConfig; onServeStart?: ServeStartHook; protocolVersion?: string; serverId?: string; } |
- |
options.dispatchHook? |
DispatchHook |
Hook invoked around each dispatched request (tracing/metrics/auth enrichment). |
options.enableDescribe? |
boolean |
Enable the describe RPC method (service self-description). Default true. |
options.externalLocation? |
ExternalLocationConfig |
Configuration for externalizing oversized record batches to blob storage. |
options.onServeStart? |
ServeStartHook |
Lifecycle hook fired once before the first dispatched request. |
options.protocolVersion? |
string |
Protocol version string reported in the service description. |
options.serverId? |
string |
Opaque per-process server identifier surfaced to clients and the landing page. |
Returns
Section titled “Returns”VgiRpcServer
Methods
Section titled “Methods”run(): Promise<void>;Defined in: src/server.ts:170
Start the server loop over stdin/stdout. Reads requests until stdin closes.
Returns
Section titled “Returns”Promise<void>
serveConnection()
Section titled “serveConnection()”serveConnection( readable, writable?,transportKind?): Promise<void>;Defined in: src/server.ts:200
Serve requests over an explicit byte-stream pair until the readable ends — the transport-agnostic core that run (stdin/stdout) is built on.
Use this to serve over any duplex channel that the stdio/unix/tcp helpers
don’t cover: a Web Worker / MessagePort bridge, an in-memory pipe, or a
pre-connected socket. The loop, on_serve_start firing, and EOF/broken-pipe
handling are identical to run.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
readable |
ReadableStream<Uint8Array<ArrayBufferLike>> | ReadableStream |
undefined |
incoming request bytes — a web ReadableStream<Uint8Array> or a Node Readable (e.g. a Duplex bridging a MessagePort). |
writable? |
number | Socket | ByteSink |
undefined |
outgoing response sink — a stdout-like fd number, or a net.Socket / structurally-compatible Duplex. Omit for the stdout fd. |
transportKind? |
TransportKind |
TransportKind.PIPE |
reported to the on_serve_start hook (default PIPE). |
Returns
Section titled “Returns”Promise<void>
