Class: HotBunnies::Queue::BaseConsumer
- Inherits:
-
DefaultConsumer
- Object
- DefaultConsumer
- HotBunnies::Queue::BaseConsumer
- Defined in:
- lib/hot_bunnies/queue.rb
Direct Known Subclasses
Instance Method Summary collapse
- #cancel ⇒ Object
- #deliver(headers, message) ⇒ Object
- #handleCancel(consumer_tag) ⇒ Object
- #handleCancelOk(consumer_tag) ⇒ Object
- #handleDelivery(consumer_tag, envelope, properties, body) ⇒ Object
- #start ⇒ Object
Instance Method Details
#cancel ⇒ Object
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
172 173 174 |
# File 'lib/hot_bunnies/queue.rb', line 172 def deliver(headers, ) 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 |
#start ⇒ Object
169 170 |
# File 'lib/hot_bunnies/queue.rb', line 169 def start end |