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

Method quitWithError

api/rpc/client.go:753–769  ·  view source on GitHub ↗
(err error, unsubscribeServer bool)

Source from the content-addressed store, hash-verified

751}
752
753func (sub *ClientSubscription) quitWithError(err error, unsubscribeServer bool) {
754 sub.quitOnce.Do(func() {
755 // The dispatch loop won't be able to execute the unsubscribe call
756 // if it is blocked on deliver. Close sub.quit first because it
757 // unblocks deliver.
758 close(sub.quit)
759 if unsubscribeServer {
760 sub.requestUnsubscribe()
761 }
762 if err != nil {
763 if err == ErrClientQuit {
764 err = nil // Adhere to subscription semantics.
765 }
766 sub.err <- err
767 }
768 })
769}
770
771func (sub *ClientSubscription) deliver(result json.RawMessage) (ok bool) {
772 select {

Callers 3

UnsubscribeMethod · 0.95
startMethod · 0.95
closeRequestOpsMethod · 0.80

Calls 1

requestUnsubscribeMethod · 0.95

Tested by

no test coverage detected