lib/amq/client/adapter.rb in amq-client-0.7.0.alpha13 vs lib/amq/client/adapter.rb in amq-client-0.7.0.alpha14

- old
+ new

@@ -107,11 +107,11 @@ # Establishes connection to AMQ broker and returns it. New connection object is yielded to # the block if it is given. # # @example Specifying adapter via the :adapter option - # AMQ::Client::Adapter.connect(adapter: "socket") + # AMQ::Client::Adapter.connect(:adapter => "socket") # @example Specifying using custom adapter class # AMQ::Client::SocketClient.connect # @param [Hash] Connection parameters, including :adapter to use. # @api public def connect(settings = nil, &block) @@ -153,10 +153,18 @@ # # @return [Class] def tcp_connection_failure_exception_class @tcp_connection_failure_exception_class ||= AMQ::Client::TCPConnectionFailed end # tcp_connection_failure_exception_class + + # Can be overriden by higher-level libraries like amqp gem or bunny. + # Defaults to AMQ::Client::PossibleAuthenticationFailure. + # + # @return [Class] + def authentication_failure_exception_class + @authentication_failure_exception_class ||= AMQ::Client::PossibleAuthenticationFailureError + end # authentication_failure_exception_class end # ClassMethods # # Behaviors @@ -201,10 +209,9 @@ # Properly close connection with AMQ broker, as described in # section 2.2.4 of the {http://bit.ly/hw2ELX AMQP 0.9.1 specification}. # # @api plugin - # @todo This method should await broker's response with Close-Ok. {http://github.com/michaelklishin MK}. # @see #close_connection def disconnect(reply_code = 200, reply_text = "Goodbye", &block) @intentionally_closing_connection = true self.on_disconnection(&block)