class RpcInterceptorStore
Since 0.3.0
Deprecated

Since M70a no first-party adapter uses this. gRPC dispatch happens inside the kernel terminal handler, after the middleware pipeline, via IGrpcService resolved from the service registry — the pre-pipeline interceptor was the security defect that change closed. Retained because the class is published surface (AI_GUIDELINES §9.2); it will be removed alongside IHttpAdapter.setRpcHandler in the next major release.

Stores an adapter's RPC interceptor and consults it safely.

Methods

consult(request: Request): Promise<Response | null>

Calls the installed handler. Returns the handler's response if it returns a Response, otherwise returns null.

A throwing handler is converted to a safe 500 Response rather than allowing the error to escape: an application bug in the handler must not take down the serve loop.

Consult exactly ONCE per request. The request is passed through undisturbed and the caller goes on to map that same Request for the Hono pipeline, so a handler returning null must not have read the body — see RpcFetchHandler. Consulting twice would break that for any body-inspecting handler even if each individual call honored the contract.

set(handler: RpcFetchHandler): void

Installs the handler. A later call replaces the previous one.

Usage

import { RpcInterceptorStore } from "runtime/src/index.ts";