Sha256: d12323db58d54c39771e7579ab6df9d587425ee7810b66ce6d68c877d2a2f11c

Contents?: true

Size: 883 Bytes

Versions: 9

Compression:

Stored size: 883 Bytes

Contents

$:.unshift File.expand_path(File.dirname(__FILE__))

%w[socket thread timeout amqp].each do |file|
	require file
end

%w[ exchange queue header ].each do |file|
  require "bunny/#{file}"
end

class Bunny
	
	attr_reader :client

	def initialize(opts = {})
		@client = AMQP::Client.new(opts)
  end

	def logging=(bool)
		client.logging = bool
	end
	
	def logging
		client.logging
	end

	def start
		client.start_session
	end

	def status
		client.status
	end
	
	def exchange(name, opts = {})
		client.exchanges[name] ||= Exchange.new(client, name, opts)
	end
  
  def queue(name, opts = {})
    client.queues[name] ||= Queue.new(client, name, opts)
  end

  def stop
    client.close
  end

  def queues
    client.queues ||= {}
  end

  def exchanges
    client.exchanges ||= {}
  end
	
	def host
		client.host
	end
	
	def vhost
		client.vhost
	end
	
	def port
		client.port
	end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
celldee-bunny-0.0.7 lib/bunny.rb
celldee-bunny-0.0.8 lib/bunny.rb
celldee-bunny-0.0.9 lib/bunny.rb
celldee-bunny-0.1.0 lib/bunny.rb
celldee-bunny-0.1.1 lib/bunny.rb
bunny-0.1.1 lib/bunny.rb
bunny-0.1.0 lib/bunny.rb
bunny-0.0.8 lib/bunny.rb
bunny-0.0.9 lib/bunny.rb