For overview of AMQP client adapters API, see {AMQ::Client::Adapter}
For overview of AMQP client adapters API, see {AMQ::Client::Adapter}
backwards compatibility @private
backwards compatibility @private
backwards compatibility @private
backwards compatibility @private
backwards compatibility @private
backwards compatibility @private
backwards compatibility @private
backwards compatibility @private
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
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
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
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
Generated with the Darkfish Rdoc Generator 2.