onRpc
onRpc<
TReq,TRes>(contract,handler,options?):RpcHandlerDeclaration
Defined in: packages/hoppity/src/handlers/onRpc.ts:15
Declares a typed RPC handler for use in the service config handlers array.
Both the request and response types are inferred from the contract’s schemas. The handler must return a Promise resolving to the response schema’s inferred type.
Type Parameters
Section titled “Type Parameters”TReq extends ZodTypeAny
TRes extends ZodTypeAny
Parameters
Section titled “Parameters”contract
Section titled “contract”RpcContract<any, any, TReq, TRes>
The RpcContract to handle
handler
Section titled “handler”RpcHandler<TReq, TRes>
The handler function
options?
Section titled “options?”Optional queue/redelivery/dead-letter overrides