lib/carrot.rb in carrot-0.7.0 vs lib/carrot.rb in carrot-0.8.0

- old
+ new

@@ -25,22 +25,26 @@ def self.logging? @logging end class Error < StandardError; end - attr_accessor :server - def initialize(opts = {}) - @server = AMQP::Server.new(opts) + @opts = opts end def queue(name, opts = {}) queues[name] ||= AMQP::Queue.new(self, name, opts) end + def server + @server ||= AMQP::Server.new(@opts) + end + def stop server.close + @server = nil end + alias :reset :stop def queues @queues ||= {} end