Sha256: 5fd166979deb353b136d5f4a32ae736dde6fdcb8a137f49db9ac92187d82165f

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

# Example consumer
# Require this file when running `songkick_queue` like so:
#
#   $ bin/songkick_queue --require ./examples/consumer.rb --consumer TweetConsumer
#
require_relative '../lib/songkick_queue'

SongkickQueue.configure do |config|
  config.host = 'localhost'
  config.logger = Logger.new(STDOUT)
end

class TweetConsumer
  include SongkickQueue::Consumer

  consume_from_queue 'notifications-service.tweets'

  def process(payload)
    puts "TweetConsumer#process(#{payload})"

    10.times do
      sleep 1
      puts "Processing..."
    end

    puts "Done processing!"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
songkick_queue-0.5.0 examples/consumer.rb