Module: HotBunnies::Channel
- Defined in:
- lib/hot_bunnies/channel.rb
Instance Method Summary collapse
- #default_exchange ⇒ Object
- #exchange(name, options = {}) ⇒ Object
- #on_return(&block) ⇒ Object
- #prefetch=(n) ⇒ Object
- #qos(options = {}) ⇒ Object
- #queue(name, options = {}) ⇒ Object
Instance Method Details
#default_exchange ⇒ Object
15 16 17 |
# File 'lib/hot_bunnies/channel.rb', line 15 def default_exchange self.exchange("", :durable => true, :auto_delete => false, :type => "direct") end |
#exchange(name, options = {}) ⇒ Object
9 10 11 12 13 |
# File 'lib/hot_bunnies/channel.rb', line 9 def exchange(name, ={}) exchange = Exchange.new(self, name, ) exchange.declare! exchange end |
#on_return(&block) ⇒ Object
30 31 32 |
# File 'lib/hot_bunnies/channel.rb', line 30 def on_return(&block) self.set_return_listener(block) end |
#prefetch=(n) ⇒ Object
26 27 28 |
# File 'lib/hot_bunnies/channel.rb', line 26 def prefetch=(n) qos(:prefetch_count => n) end |
#qos(options = {}) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/hot_bunnies/channel.rb', line 19 def qos(={}) if .size == 1 && [:prefetch_count] then basic_qos([:prefetch_count]) else basic_qos(.fetch(:prefetch_size, 0), .fetch(:prefetch_count, 0), .fetch(:global, false)) end end |