if async, caller must call finalize
()
| 745 | |
| 746 | // if async, caller must call finalize |
| 747 | func (handler *RpcResponseHandler) Finalize() { |
| 748 | // Always unregister the handler from the map, even if already done |
| 749 | if handler.reqId != "" { |
| 750 | handler.w.unregisterResponseHandler(handler.reqId) |
| 751 | } |
| 752 | if handler.done.Load() { |
| 753 | return |
| 754 | } |
| 755 | // SendResponse with done=true will call close() via defer, even when reqId is empty |
| 756 | handler.SendResponse(nil, true) |
| 757 | } |
| 758 | |
| 759 | func (handler *RpcResponseHandler) IsDone() bool { |
| 760 | return handler.done.Load() |
no test coverage detected