MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / registerRpc

Method registerRpc

pkg/wshutil/wshrpc.go:469–487  ·  view source on GitHub ↗
(handler *RpcRequestHandler, command string, route string, reqId string)

Source from the content-addressed store, hash-verified

467}
468
469func (w *WshRpc) registerRpc(handler *RpcRequestHandler, command string, route string, reqId string) chan *RpcMessage {
470 w.Lock.Lock()
471 defer w.Lock.Unlock()
472 rpcCh := make(chan *RpcMessage, RespChSize)
473 w.RpcMap[reqId] = &rpcData{
474 Handler: handler,
475 Command: command,
476 Route: route,
477 ResCh: rpcCh,
478 }
479 go func() {
480 defer func() {
481 panichandler.PanicHandler("registerRpc:timeout", recover())
482 }()
483 <-handler.ctx.Done()
484 w.retrySendTimeout(reqId)
485 }()
486 return rpcCh
487}
488
489func (w *WshRpc) unregisterRpc(reqId string, err error) {
490 w.Lock.Lock()

Callers 1

SendComplexRequestMethod · 0.95

Calls 2

retrySendTimeoutMethod · 0.95
PanicHandlerFunction · 0.92

Tested by

no test coverage detected