MCPcopy
hub / github.com/wavetermdev/waveterm / wshRpcStream

Method wshRpcStream

frontend/app/store/wshclient.ts:75–93  ·  view source on GitHub ↗
(command: string, data: any, opts: RpcOpts)

Source from the content-addressed store, hash-verified

73 }
74
75 wshRpcStream(command: string, data: any, opts: RpcOpts): AsyncGenerator<any, void, boolean> {
76 if (opts?.noresponse) {
77 throw new Error("noresponse not supported for responsestream calls");
78 }
79 const msg: RpcMessage = {
80 command: command,
81 data: data,
82 reqid: crypto.randomUUID(),
83 source: this.routeId,
84 };
85 if (opts?.timeout) {
86 msg.timeout = opts.timeout;
87 }
88 if (opts?.route) {
89 msg.route = opts.route;
90 }
91 const rpcGen = sendRpcCommand(this.openRpcs, msg);
92 return rpcGen;
93 }
94
95 async handleIncomingCommand(msg: RpcMessage) {
96 // TODO implement a timeout (setTimeout + sendResponse)

Callers 7

FileListStreamCommandMethod · 0.80
StreamCpuDataCommandMethod · 0.80
StreamTestCommandMethod · 0.80
VDomRenderCommandMethod · 0.80
VDomUrlRequestCommandMethod · 0.80

Calls 1

sendRpcCommandFunction · 0.90

Tested by

no test coverage detected