lib/amq/client.rb in amq-client-0.7.0.alpha23 vs lib/amq/client.rb in amq-client-0.7.0.alpha24
- old
+ new
@@ -1,9 +1,10 @@
# encoding: utf-8
require "amq/client/version"
require "amq/client/exceptions"
+require "amq/client/handlers_registry"
require "amq/client/adapter"
require "amq/client/channel"
require "amq/client/exchange"
require "amq/client/queue"
@@ -21,12 +22,12 @@
module Client
# List all the available as a hash of {adapter_name: metadata},
# where metadata are hash with :path and :const_name keys.
#
# @example
- # AMQ::Client.adapters[:socket]
- # # => {path: full_path, const_name: "SocketClient"}}
+ # AMQ::Client.adapters[:event_machine] # => {path: "...", const_name: "EventMachineClient"}}
+ #
# @return [Hash]
# @api public
def self.adapters
@adapters ||= begin
root = File.expand_path("../client/adapters", __FILE__)
@@ -48,11 +49,11 @@
# # Use the client.
# end
# @param [Hash] Connection parameters, including :adapter to use.
# @api public
def self.connect(settings = nil, &block)
- adapter = (settings && settings.delete(:adapter)) || :socket
+ adapter = (settings && settings.delete(:adapter))
adapter = load_adapter(adapter)
adapter.connect(settings, &block)
end
# Loads adapter from amq/client/adapters.
@@ -64,7 +65,7 @@
require meta[:path]
const_get(meta[:const_name])
rescue LoadError
raise InvalidAdapterNameError.new(adapter)
end
- end
-end
+ end # Client
+end # AMQ