Class: Liebre::Adapter::Bunny::Chan
- Inherits:
-
Object
- Object
- Liebre::Adapter::Bunny::Chan
- Includes:
- Interface::Chan
- Defined in:
- lib/liebre/adapter/bunny/chan.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
Instance Method Summary collapse
- #close ⇒ Object
- #default_exchange ⇒ Object
- #exchange(name, type, opts) ⇒ Object
-
#initialize(channel) ⇒ Chan
constructor
A new instance of Chan.
- #queue(name, opts) ⇒ Object
- #set_prefetch(count) ⇒ Object
Constructor Details
#initialize(channel) ⇒ Chan
Returns a new instance of Chan.
9 10 11 |
# File 'lib/liebre/adapter/bunny/chan.rb', line 9 def initialize channel @channel = channel end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
7 8 9 |
# File 'lib/liebre/adapter/bunny/chan.rb', line 7 def channel @channel end |
Instance Method Details
#close ⇒ Object
31 32 33 |
# File 'lib/liebre/adapter/bunny/chan.rb', line 31 def close channel.close end |
#default_exchange ⇒ Object
13 14 15 |
# File 'lib/liebre/adapter/bunny/chan.rb', line 13 def default_exchange Exchange.new(channel.default_exchange) end |
#exchange(name, type, opts) ⇒ Object
17 18 19 20 21 |
# File 'lib/liebre/adapter/bunny/chan.rb', line 17 def exchange name, type, opts opts = opts.merge(:type => type) Exchange.new(channel.exchange(name, opts)) end |
#queue(name, opts) ⇒ Object
23 24 25 |
# File 'lib/liebre/adapter/bunny/chan.rb', line 23 def queue name, opts Queue.new(channel.queue(name, opts)) end |
#set_prefetch(count) ⇒ Object
27 28 29 |
# File 'lib/liebre/adapter/bunny/chan.rb', line 27 def set_prefetch count channel.basic_qos(count, false) end |