Open
Conversation
ec73e62 to
f79bbb5
Compare
This renames `#do_finish` to `#quit!`, makes it public, adds an option to convert exceptions into warnings, and extracts the contents of the ensure block into a new public `#disconnect` method. The motivation for making these public is given in the rdoc. As documented in the rdoc, `#quit!`: > Calls #quit and ensures that #disconnect is called. Returns the > result from #quit. Returns +nil+ when the client is already > disconnected or when a prior error prevents the client from calling > #quit. Unlike #finish, this an exception will not be raised when the > client has not started. > > If #quit raises a StandardError, the connection is dropped and the > exception is re-raised. When <tt>exception: :warn</tt> is specified, > a warning is printed and the exception is returned. When > <tt>exception: false</tt> is specified, the warning is not printed. > This is useful when the connection must be dropped, for example in a > test suite or due to security concerns. As documented in the rdoc, `#disconnect`: > Disconnects the socket without checking if the connection has started > yet, and without sending a final QUIT message to the server. > > Generally, either #finish or #quit! should be used instead. fix docs fix doc
f79bbb5 to
1db3a9e
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are circumstances when an authenticator needs to disconnect the client before
@start = true. This PR refactors the private#do_finishmethod:#quit!,#disconnectmethod.The motivation for making these public is given in the rdoc.
As documented in the rdoc,
#quit!:As documented in the rdoc,
#disconnect: