-
Notifications
You must be signed in to change notification settings - Fork 700
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
[ADDED] Force reconnect #1624
[ADDED] Force reconnect #1624
Conversation
Signed-off-by: Piotr Piotrowski <[email protected]>
3242548
to
29dd974
Compare
@piotrpio |
Signed-off-by: Piotr Piotrowski <[email protected]>
Signed-off-by: Piotr Piotrowski <[email protected]>
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
func TestForceReconnect(t *testing.T) { | ||
s := RunDefaultServer() | ||
|
||
nc, err := nats.Connect(s.ClientURL(), nats.ReconnectWait(10*time.Second)) |
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.
Only one behavior that wanted to confirm is whether we get an error on disconnect or not, and it seems the disconnect callback is called but without an error which I think it is good, e.g.
nats.DisconnectErrHandler(func(_ *nats.Conn, err error) {
t.Logf("ERROR: %v", err) // error is nil here
}),
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.
Yes, the callback is invoked without error which I thought is a reasonable behavior.
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
Signed-off-by: Piotr Piotrowski <[email protected]>
Signed-off-by: Piotr Piotrowski <[email protected]>
Addresses nats-io/nats-architecture-and-design#259
Signed-off-by: Piotr Piotrowski [email protected]