diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-03 19:56:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-03 19:56:00 +0800 |
commit | 7734ead52030a6c128613331ea4a24afd9d4173a (patch) | |
tree | 7bed2d0085c7a9cac97691ccf561976119f45c78 /rpc | |
parent | 8b57c494908637a5c0e74f8f7a13b3218e026757 (diff) | |
parent | 1bed9b3fea9939581b03cae9d6b4984ced456748 (diff) | |
download | dexon-7734ead52030a6c128613331ea4a24afd9d4173a.tar dexon-7734ead52030a6c128613331ea4a24afd9d4173a.tar.gz dexon-7734ead52030a6c128613331ea4a24afd9d4173a.tar.bz2 dexon-7734ead52030a6c128613331ea4a24afd9d4173a.tar.lz dexon-7734ead52030a6c128613331ea4a24afd9d4173a.tar.xz dexon-7734ead52030a6c128613331ea4a24afd9d4173a.tar.zst dexon-7734ead52030a6c128613331ea4a24afd9d4173a.zip |
Merge pull request #3605 from fjl/event-feed
event: add new Subscription type and related utilities
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/client.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rpc/client.go b/rpc/client.go index 34a3b7831..269eb78c8 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -682,7 +682,7 @@ func newClientSubscription(c *Client, channel reflect.Value) *ClientSubscription // resubscription when the client connection is closed unexpectedly. // // The error channel receives a value when the subscription has ended due -// to an error. The received error is ErrClientQuit if Close has been called +// to an error. The received error is nil if Close has been called // on the underlying client and no other error has occurred. // // The error channel is closed when Unsubscribe is called on the subscription. @@ -707,6 +707,9 @@ func (sub *ClientSubscription) quitWithError(err error, unsubscribeServer bool) sub.requestUnsubscribe() } if err != nil { + if err == ErrClientQuit { + err = nil // Adhere to subscription semantics. + } sub.err <- err } }) |