good morning!!!!

Skip to content
Snippets Groups Projects
Commit a2b4abd8 authored by Felix Lange's avatar Felix Lange
Browse files

rpc: send nil on subscription Err channel when Client is closed

This change makes client subscriptions compatible with the new
Subscription semantics introduced in the previous commit.
parent 6d5e100d
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment