MCPcopy Create free account
hub / github.com/CPChain/chain / closeRequestOps

Method closeRequestOps

api/rpc/client.go:610–627  ·  view source on GitHub ↗

closeRequestOps unblocks pending send ops and active subscriptions.

(err error)

Source from the content-addressed store, hash-verified

608
609// closeRequestOps unblocks pending send ops and active subscriptions.
610func (c *Client) closeRequestOps(err error) {
611 didClose := make(map[*requestOp]bool)
612
613 for id, op := range c.respWait {
614 // Remove the op so that later calls will not close op.resp again.
615 delete(c.respWait, id)
616
617 if !didClose[op] {
618 op.err = err
619 close(op.resp)
620 didClose[op] = true
621 }
622 }
623 for id, sub := range c.subs {
624 delete(c.subs, id)
625 sub.quitWithError(err, false)
626 }
627}
628
629func (c *Client) handleNotification(msg *jsonrpcMessage) {
630 if !strings.HasSuffix(msg.Method, notificationMethodSuffix) {

Callers 1

dispatchMethod · 0.95

Calls 1

quitWithErrorMethod · 0.80

Tested by

no test coverage detected