Class: Hopper::Channel::Queue::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/hopper/channel/queue.rb

Instance Method Summary collapse

Constructor Details

#initialize(bunny) ⇒ Proxy

Returns a new instance of Proxy.


5
6
7
# File 'lib/hopper/channel/queue.rb', line 5

def initialize(bunny)
  @bunny = bunny
end

Instance Method Details

#channelObject


9
10
11
# File 'lib/hopper/channel/queue.rb', line 9

def channel
  @bunny.channel
end

#publish(message, opts = {}) ⇒ Object


13
14
15
# File 'lib/hopper/channel/queue.rb', line 13

def publish(message, opts = {})
  @bunny.publish(message, opts)
end

#subscribe(*args) ⇒ Object


17
18
19
20
21
# File 'lib/hopper/channel/queue.rb', line 17

def subscribe(*args)
  @bunny.subscribe(*args) do |*a|
    yield a
  end
end