mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 16:02:50 +00:00
refactor(rpc): keep dispatcher under line budget
This commit is contained in:
@@ -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() }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user