(err error, unsubscribeServer bool)
| 751 | } |
| 752 | |
| 753 | func (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 | |
| 771 | func (sub *ClientSubscription) deliver(result json.RawMessage) (ok bool) { |
| 772 | select { |
no test coverage detected