Sha256: 517dc73061896dbe8dd84b8fe8874b18b4fc5f9c4d62060b1c752d8aef9e499e
Contents?: true
Size: 455 Bytes
Versions: 1
Compression:
Stored size: 455 Bytes
Contents
require 'bunny_carrot' require 'logger' require "stringio" logger = Logger.new(StringIO.new) BunnyCarrot.logger = logger ENV["RABBITMQ_URL"] = "amqp://127.0.0.1:5672" QUEUE_NAME = ARGV[0] class BusinessWorker < BunnyCarrot::BaseWorker def perform(payload, headers) print payload['message'] end end begin Timeout.timeout(5) do BunnyCarrot::Consumer.subscribe(QUEUE_NAME, BusinessWorker.new, block: true) end rescue Timeout::Error end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bunny_carrot-0.0.2 | spec/fixtures/consumer.rb |