Module: SongkickQueue::Consumer::ClassMethods

Defined in:
lib/songkick_queue/consumer.rb

Instance Method Summary collapse

Instance Method Details

#consume_from_queue(queue_name) ⇒ Object

Define the name of the queue this consumer with process messages from


9
10
11
# File 'lib/songkick_queue/consumer.rb', line 9

def consume_from_queue(queue_name)
  @queue_name = queue_name
end

#queue_nameObject

Return the quene name set by #consume_from_queue

Raises:

  • (NotImplementedError)

    if queue name was not already defined


16
17
18
19
# File 'lib/songkick_queue/consumer.rb', line 16

def queue_name
  @queue_name || fail(NotImplementedError, 'you must declare a queue name to consume from ' +
    'by calling #consume_from_queue in your consumer class. See README for more info.')
end