()
| 591 | } |
| 592 | |
| 593 | func (handler *RpcRequestHandler) NextResponse() (any, error) { |
| 594 | var resp *RpcMessage |
| 595 | if handler.cachedResp != nil { |
| 596 | resp = handler.cachedResp |
| 597 | handler.cachedResp = nil |
| 598 | } else { |
| 599 | resp = <-handler.respCh |
| 600 | } |
| 601 | if resp == nil { |
| 602 | return nil, errors.New("response channel closed") |
| 603 | } |
| 604 | if resp.Error != "" { |
| 605 | return nil, errors.New(resp.Error) |
| 606 | } |
| 607 | return resp.Data, nil |
| 608 | } |
| 609 | |
| 610 | func (handler *RpcRequestHandler) finalize() { |
| 611 | handler.callContextCancelFn() |
no outgoing calls
no test coverage detected