Class: HotBunnies::Queue::BaseConsumer

Inherits:
DefaultConsumer
  • Object
show all
Defined in:
lib/hot_bunnies/queue.rb

Direct Known Subclasses

CallbackConsumer

Instance Method Summary collapse

Instance Method Details

#cancelObject



176
177
178
179
# File 'lib/hot_bunnies/queue.rb', line 176

def cancel
  channel.basic_cancel(consumer_tag)
  @cancelling = true
end

#deliver(headers, message) ⇒ Object

Raises:

  • (NotImplementedError)


172
173
174
# File 'lib/hot_bunnies/queue.rb', line 172

def deliver(headers, message)
  raise NotImplementedError, 'To be implemented by a subclass'
end

#handleCancel(consumer_tag) ⇒ Object



161
162
163
# File 'lib/hot_bunnies/queue.rb', line 161

def handleCancel(consumer_tag)
  @cancelled = true
end

#handleCancelOk(consumer_tag) ⇒ Object



165
166
167
# File 'lib/hot_bunnies/queue.rb', line 165

def handleCancelOk(consumer_tag)
  @cancelled = true
end

#handleDelivery(consumer_tag, envelope, properties, body) ⇒ Object



155
156
157
158
159
# File 'lib/hot_bunnies/queue.rb', line 155

def handleDelivery(consumer_tag, envelope, properties, body)
  body = String.from_java_bytes(body)
  headers = Headers.new(channel, consumer_tag, envelope, properties)
  deliver(headers, body)
end

#startObject



169
170
# File 'lib/hot_bunnies/queue.rb', line 169

def start
end