Module: AMQ::Client::Async::Adapter::ClassMethods

### Home Classes Methods

### In Files

- lib/amq/client/async/adapter.rb

### Methods

- #authentication_failure_exception_class
- #connect
- #logger
- #logger=
- #logging
- #logging=
- #settings
- #tcp_connection_failure_exception_class

### Class/Module Index

Quicksearch

- AMQ
- AMQ::Client
- AMQ::Client::Async
- AMQ::Client::Async::Adapter
- AMQ::Client::Async::Adapter::ClassMethods
- AMQ::Client::Async::AuthMechanismAdapter
- AMQ::Client::Async::AuthMechanismAdapter::External
- AMQ::Client::Async::AuthMechanismAdapter::Plain
- AMQ::Client::Async::Callbacks
- AMQ::Client::Async::Channel
- AMQ::Client::Async::Consumer
- AMQ::Client::Async::CoolioClient
- AMQ::Client::Async::CoolioClient::Socket
- AMQ::Client::Async::Entity
- AMQ::Client::Async::EventMachineClient
- AMQ::Client::Async::Exchange
- AMQ::Client::Async::Extensions
- AMQ::Client::Async::Extensions::RabbitMQ
- AMQ::Client::Async::Extensions::RabbitMQ::Basic
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::ChannelMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::ConsumerMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::QueueMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Confirm
- AMQ::Client::Async::Extensions::RabbitMQ::Confirm::ChannelMixin
- AMQ::Client::Async::ProtocolMethodHandlers
- AMQ::Client::Async::Queue
- AMQ::Client::Async::RegisterEntityMixin
- AMQ::Client::BadLengthError
- AMQ::Client::ConnectionClosedError
- AMQ::Client::ConsumerTagGenerator
- AMQ::Client::Framing
- AMQ::Client::Framing::IO
- AMQ::Client::Framing::IO::Frame
- AMQ::Client::Framing::String
- AMQ::Client::Framing::String::Frame
- AMQ::Client::HandlersRegistry
- AMQ::Client::InconsistentDataError
- AMQ::Client::Logging
- AMQ::Client::Logging::IncompatibleLoggerError
- AMQ::Client::MissingHandlerError
- AMQ::Client::NoFinalOctetError
- AMQ::Client::Openable
- AMQ::Client::Openable::ImproperStatusError
- AMQ::Client::PossibleAuthenticationFailureError
- AMQ::Client::ServerNamedEntity
- AMQ::Client::Settings
- AMQ::Client::TCPConnectionFailed
- AMQ::Client::UnknownExchangeTypeError
- AMQ::Protocol
- AMQ::Protocol::GetResponse

No matching classes.

# AMQ::Client::Async::Adapter::ClassMethods

### Public Instance Methods

authentication_failure_exception_class() click to toggle source

Can be overriden by higher-level libraries like amqp gem or bunny. Defaults to AMQ::Client::PossibleAuthenticationFailure.

@return [Class]

    # File lib/amq/client/async/adapter.rb, line 175
    def authentication_failure_exception_class
      @authentication_failure_exception_class ||= AMQ::Client::PossibleAuthenticationFailureError
    end

connect(settings = nil, &block) click to toggle source

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")

@example Specifying using custom adapter class

    AMQ::Client::SocketClient.connect

@param [Hash] Connection parameters, including :adapter to use. @api public

    # File lib/amq/client/async/adapter.rb, line 152
    def connect(settings = nil, &block)
      @settings = Settings.configure(settings)

      instance = self.new
      instance.establish_connection(settings)
      instance.register_connection_callback(&block)

      instance
    end

logger() click to toggle source

    # File lib/amq/client/async/adapter.rb, line 116
    def logger
      @logger ||= begin
                    require "logger"
                    Logger.new(STDERR)
                  end
    end

logger=(logger) click to toggle source

    # File lib/amq/client/async/adapter.rb, line 123
    def logger=(logger)
      methods = AMQ::Client::Logging::REQUIRED_METHODS
      unless methods.all? { |method| logger.respond_to?(method) }
        raise AMQ::Client::Logging::IncompatibleLoggerError.new(methods)
      end

      @logger = logger
    end

logging() click to toggle source

@return [Boolean] Current value of logging flag.

    # File lib/amq/client/async/adapter.rb, line 133
    def logging
      settings[:logging]
    end

logging=(boolean) click to toggle source

Turns loggin on or off.

    # File lib/amq/client/async/adapter.rb, line 138
    def logging=(boolean)
      settings[:logging] = boolean
    end

settings() click to toggle source

Settings

    # File lib/amq/client/async/adapter.rb, line 112
    def settings
      @settings ||= AMQ::Client::Settings.default
    end

tcp_connection_failure_exception_class() click to toggle source

Can be overriden by higher-level libraries like amqp gem or bunny. Defaults to AMQ::Client::TCPConnectionFailed.

@return [Class]

    # File lib/amq/client/async/adapter.rb, line 167
    def tcp_connection_failure_exception_class
      @tcp_connection_failure_exception_class ||= AMQ::Client::TCPConnectionFailed
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.