Skip to content
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

Public disconnect methods #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on May 8, 2024

  1. Extract public quit!/disconnect from do_finish

    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
    nevans committed May 8, 2024
    Configuration menu
    Copy the full SHA
    87aca64 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f79bbb5 View commit details
    Browse the repository at this point in the history