(handler *RpcRequestHandler, command string, route string, reqId string)
| 467 | } |
| 468 | |
| 469 | func (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 | |
| 489 | func (w *WshRpc) unregisterRpc(reqId string, err error) { |
| 490 | w.Lock.Lock() |
no test coverage detected