MethodDefinition
Defined in: src/types.ts:224
In-memory definition of one registered RPC method, produced by the
Protocol builder and consumed by the dispatch layer. Which optional
fields are populated depends on the method type: handler for unary
methods, producerInit/producerFn for producer streams, and
exchangeInit/exchangeFn for exchange streams.
Properties
Section titled “Properties”defaults?
Section titled “defaults?”optional defaults?: Record<string, any>;Defined in: src/types.ts:256
Default values applied to omitted request parameters.
optional doc?: string;Defined in: src/types.ts:254
Human-readable method documentation, surfaced via introspection.
exchangeFn?
Section titled “exchangeFn?”optional exchangeFn?: ExchangeFn<any>;Defined in: src/types.ts:246
Handles each input batch of an exchange stream.
exchangeInit?
Section titled “exchangeInit?”optional exchangeInit?: ExchangeInit<any>;Defined in: src/types.ts:244
Builds the initial state object for an exchange stream.
handler?
Section titled “handler?”optional handler?: UnaryHandler;Defined in: src/types.ts:238
Implementation for unary methods.
headerInit?
Section titled “headerInit?”optional headerInit?: HeaderInit;Defined in: src/types.ts:250
Builds the optional header batch emitted before the first output batch.
headerSchema?
Section titled “headerSchema?”optional headerSchema?: VgiSchema;Defined in: src/types.ts:248
Schema of the optional per-stream header batch.
inputSchema?
Section titled “inputSchema?”optional inputSchema?: VgiSchema;Defined in: src/types.ts:236
Schema of streamed input batches (exchange streams only).
name: string;Defined in: src/types.ts:226
Method name as registered on the protocol.
onCancel?
Section titled “onCancel?”optional onCancel?: OnCancelFn<any>;Defined in: src/types.ts:252
Optional hook run when the client cancels a stream.
outputSchema?
Section titled “outputSchema?”optional outputSchema?: VgiSchema;Defined in: src/types.ts:234
Schema of streamed output batches (producer and exchange streams).
paramsSchema
Section titled “paramsSchema”paramsSchema: VgiSchema;Defined in: src/types.ts:230
Schema of the request parameters batch.
paramTypes?
Section titled “paramTypes?”optional paramTypes?: Record<string, string>;Defined in: src/types.ts:258
Human-readable parameter type names, surfaced via introspection.
producerFn?
Section titled “producerFn?”optional producerFn?: ProducerFn<any>;Defined in: src/types.ts:242
Produces output batches for a producer stream.
producerInit?
Section titled “producerInit?”optional producerInit?: ProducerInit<any>;Defined in: src/types.ts:240
Builds the initial state object for a producer stream.
resultSchema
Section titled “resultSchema”resultSchema: VgiSchema;Defined in: src/types.ts:232
Schema of the unary result batch (unused for streams).
type: MethodType;Defined in: src/types.ts:228
Whether the method is unary or streaming.