refactor(rpc): keep dispatcher under line budget

This commit is contained in:
Jinwoo-H
2026-08-30 21:47:51 -04:00
parent 0b378f3e29
commit f98ad01ebb
+2 -6
View File
@@ -46,7 +46,7 @@ export class RpcDispatcher {
}
async dispatch(request: RpcRequest, options?: DispatchCallOptions): Promise<RpcResponse> {
const meta = this.meta()
const meta: RpcEnvelopeMeta = { runtimeId: this.runtime.getRuntimeId() }
const method = this.registry.get(request.method)
if (!method) {
return errorResponse(
@@ -166,7 +166,7 @@ export class RpcDispatcher {
reply: (response: string) => void,
options?: RpcDispatchStreamingOptions
): Promise<void> {
const meta = this.meta()
const meta: RpcEnvelopeMeta = { runtimeId: this.runtime.getRuntimeId() }
const method = this.registry.get(request.method)
if (!method) {
reply(
@@ -312,8 +312,4 @@ export class RpcDispatcher {
reply(JSON.stringify(mapDispatcherError(request, meta, error)))
}
}
private meta(): RpcEnvelopeMeta {
return { runtimeId: this.runtime.getRuntimeId() }
}
}