module Hutch::Consumer
Include this module in a class to register it as a consumer. Consumers gain a class method called ‘consume`, which should be used to register the routing keys a consumer is interested in.
Attributes
broker[RW]
delivery_info[RW]
Public Class Methods
included(base)
click to toggle source
# File lib/hutch/consumer.rb, line 10 def self.included(base) base.extend(ClassMethods) Hutch.register_consumer(base) end
Public Instance Methods
logger()
click to toggle source
# File lib/hutch/consumer.rb, line 23 def logger Hutch::Logging.logger end
reject!()
click to toggle source
# File lib/hutch/consumer.rb, line 15 def reject! broker.reject(delivery_info.delivery_tag) end
requeue!()
click to toggle source
# File lib/hutch/consumer.rb, line 19 def requeue! broker.requeue(delivery_info.delivery_tag) end