(command: string, data: any, opts: RpcOpts)
| 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) |
no test coverage detected