New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different approach to address initial pending == 0 #902
Conversation
This is undoing changes done in PR #901 and makes the changes dicussed in the comments of that PR. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@ripienaar @derekcollison This is another approach, which I sort of prefer. The addconsumer then js.Subscribe() with special option looked a bit of a hack and was not too comfortable with that. @derekcollison Before you complain about use of lock in the watcher :-)
|
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Should be done really only when the library successfully created the consumer. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -1573,6 +1566,7 @@ func (js *js) subscribe(subj, queue string, cb MsgHandler, ch chan *Msg, isSync, | |||
// Since the library created the JS consumer, it will delete it on Unsubscribe()/Drain() | |||
sub.mu.Lock() | |||
sub.jsi.dc = true | |||
sub.jsi.pending = info.NumPending + info.Delivered.Consumer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good, and this PR is much nicer thanks.
This is undoing changes done in PR #901
and makes the changes dicussed in the comments of that PR.
Signed-off-by: Ivan Kozlovic ivan@synadia.com