Method: Propono::Client#drain_queue

Defined in:
lib/propono/components/client.rb

#drain_queue(topic, &message_processor) ⇒ Object

Listens on a queue and yields for each message

Calling this will enter a queue-listening loop that yields the message_processor for each messages. The loop will end when all messages have been processed.

This method will automatically create a subscription if one does not exist, so there is no need to call subscribe in addition.

Parameters:

  • topic (String)

    The topic to subscribe to.

  • &message_processor

    The block to yield for each message.



93
94
95
# File 'lib/propono/components/client.rb', line 93

def drain_queue(topic, &message_processor)
  QueueListener.drain(aws_client, config, topic, &message_processor)
end