Module: AMQ::Client

### Home Classes Methods

### In Files

- lib/amq/client.rb
- lib/amq/client/adapter.rb
- lib/amq/client/adapters/coolio.rb
- lib/amq/client/adapters/event_machine.rb
- lib/amq/client/async/adapter.rb
- lib/amq/client/async/adapters/coolio.rb
- lib/amq/client/async/adapters/event_machine.rb
- lib/amq/client/async/callbacks.rb
- lib/amq/client/async/consumer.rb
- lib/amq/client/async/entity.rb
- lib/amq/client/async/exchange.rb
- lib/amq/client/async/extensions/rabbitmq/basic.rb
- lib/amq/client/async/extensions/rabbitmq/cancel.rb
- lib/amq/client/async/extensions/rabbitmq/confirm.rb
- lib/amq/client/async/queue.rb
- lib/amq/client/callbacks.rb
- lib/amq/client/channel.rb
- lib/amq/client/consumer_tag_generator.rb
- lib/amq/client/entity.rb
- lib/amq/client/exceptions.rb
- lib/amq/client/exchange.rb
- lib/amq/client/extensions/rabbitmq/basic.rb
- lib/amq/client/extensions/rabbitmq/cancel.rb
- lib/amq/client/extensions/rabbitmq/confirm.rb
- lib/amq/client/framing/io/frame.rb
- lib/amq/client/framing/string/frame.rb
- lib/amq/client/handlers_registry.rb
- lib/amq/client/logging.rb
- lib/amq/client/openable.rb
- lib/amq/client/queue.rb
- lib/amq/client/server_named_entity.rb
- lib/amq/client/version.rb

### Namespace

- MODULE AMQ::Client::Async
- MODULE AMQ::Client::Framing
- MODULE AMQ::Client::Logging
- MODULE AMQ::Client::Openable
- MODULE AMQ::Client::ServerNamedEntity
- MODULE AMQ::Client::Settings
- CLASS AMQ::Client::BadLengthError
- CLASS AMQ::Client::ConnectionClosedError
- CLASS AMQ::Client::ConsumerTagGenerator
- CLASS AMQ::Client::HandlersRegistry
- CLASS AMQ::Client::InconsistentDataError
- CLASS AMQ::Client::MissingHandlerError
- CLASS AMQ::Client::NoFinalOctetError
- CLASS AMQ::Client::PossibleAuthenticationFailureError
- CLASS AMQ::Client::TCPConnectionFailed
- CLASS AMQ::Client::UnknownExchangeTypeError

### Methods

- ::adapters
- ::async_adapters
- ::connect
- ::load_adapter

### 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

For overview of AMQP client adapters API, see {AMQ::Client::Adapter}

For overview of AMQP client adapters API, see {AMQ::Client::Adapter}

### Constants

Adapter

  backwards compatibility @private

Callbacks

  backwards compatibility @private

Channel

  backwards compatibility @private

CoolioClient

  backwards compatibility @private

Entity
EventMachineClient

  backwards compatibility @private

Exchange

  backwards compatibility @private

Extensions

  backwards compatibility @private

ProtocolMethodHandlers
Queue
RegisterEntityMixin

  backwards compatibility @private

VERSION

### Public Class Methods

adapters() click to toggle source

List available adapters as a hash of { :adapter_name => metadata }, where metadata are hash with :path and :const_name keys.

@return [Hash] @api plugin

    # File lib/amq/client.rb, line 27
    def self.adapters
      @adapters ||= (self.async_adapters)
    end

async_adapters() click to toggle source

List available asynchronous adapters.

@return [Hash] @api plugin @see AMQ::Client.adapters

    # File lib/amq/client.rb, line 36
    def self.async_adapters
      @async_adapters ||= {
        :eventmachine  => {
          :path       => "amq/client/async/adapters/eventmachine",
          :const_name => "Async::EventMachineClient"
        },
        :event_machine => {
          :path       => "amq/client/async/adapters/eventmachine",
          :const_name => "Async::EventMachineClient"
        },
        :coolio        => {
          :path       => "amq/client/async/adapters/coolio",
          :const_name => "Async::CoolioClient"
        }
      }
    end

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

Establishes connection to AMQ broker using given adapter (defaults to the socket adapter) and returns it. The new connection object is yielded to the block if it is given.

@example

    AMQ::Client.connect(adapter: "socket") do |client|
      # Use the client.
    end

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

    # File lib/amq/client.rb, line 64
    def self.connect(settings = nil, &block)
      adapter  = (settings && settings.delete(:adapter))
      adapter  = load_adapter(adapter)
      adapter.connect(settings, &block)
    end

load_adapter(adapter) click to toggle source

Loads adapter given its name as a Symbol.

@raise [InvalidAdapterNameError] When loading attempt failed (LoadError was raised).

    # File lib/amq/client.rb, line 73
    def self.load_adapter(adapter)
      meta = self.adapters[adapter.to_sym]

      require meta[:path]
      eval(meta[:const_name])
    rescue LoadError
      raise InvalidAdapterNameError.new(adapter)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.