-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED] Conn and Subscription Close()/Unubscribe() could not be retried
If a connection is closed, or a subscription is closed or unsubscribed, and an error occurs at the protocol level, for instance getting a timeout or the NATS connection is currently disconnected, etc.. the Close()/Unsubscribe() calls would return an error but the user would not be able to invoke them again, in the sense that these calls would bail out early because those objects were already marked as closed. This was problematic because if an application closes a connection for instance but gets a timeout, then there is no way for the application to really try to tell the server that the connection should be closed. (same for subscription). This PR let the user call Close()/Unsubscribe() until the call is completely successful. This is not restricted to only timeout error, and it is left to the user to decide which error should be re-tryable. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
- Loading branch information
Showing
3 changed files
with
188 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters